NSTextfield setStringValue will not change label text.

Hello All,
I am about to my wits end on this particular issue that I am expierencing. I am unable to set the title of a simple label. I have tried all sorts of things like [self.property setStringValue:@"test"] and not even that will work in changing the labels. I've followed countless tutorials and other online references and they all appear to done this the exact same as I have... I would greatly appreciate recieving a little help in figuring out why it's happening and how it should be fixed properly. The easiest way to show what I have so far will be via screenshots and code examples.
xib file and containing outlets of the labels in question. This is to show that the labels are propperly hooked up as IBOutlets
Here is the relevant code. This is what is called in AppDelegate so you know where to start reading in the code:
-(void)applicationDidFinishLaunching:(NSNotification *)aNotification{
     RamdiskSize *caller =[[RamdiskSize alloc]init];
     [caller changeSizeLabels];
And here is the results, as you can see the placeholder strings are still in place and were not affected by the setStringValue methods.
And I will include all related code below:
AppDelegate.m:
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
    RamdiskSize *caller =[[RamdiskSize alloc]init];
    [caller changeSizeLabels];
@end
RamdiskSize.h:
#import <Foundation/Foundation.h>
#import "MemoryMonitoring.h"
@interface RamdiskSize : NSObject
@property (weak) IBOutlet NSTextField *minSizeLabel;
@property (weak) IBOutlet NSTextField *halfSizeLabel;
@property (weak) IBOutlet NSTextField *maxSizeLabel;
-(void)changeTextLabel:(NSTextField *)whichlabel sizeLabel:(NSString *)labelText;
-(NSArray *)defineSizeValueLabels;
-(void)changeSizeLabels;
@end
RamdiskSize.m
#import "RamdiskSize.h"
@implementation RamdiskSize
@synthesize maxSizeLabel, minSizeLabel, halfSizeLabel;
-(void)changeTextLabel:(NSTextField *)whichlabel sizeLabel:(NSString *)labelText{
    [whichlabel setStringValue:labelText];
//  Get Physical memory in MB
-(NSArray *)defineSizeValueLabels{
    MemoryMonitoring *physicalMemoryObj = [[MemoryMonitoring alloc]init];
    unsigned long long physicalMemoryValue = [physicalMemoryObj getPhysicalMemoryValue];
    float maxSize = (((float)physicalMemoryValue/1024)/1);
    float halfSize = (((float)physicalMemoryValue/1024)/2);
    float minSize = ((((float)physicalMemoryValue/1024)/((float)physicalMemoryValue/1024))/2);
    return [[NSArray alloc] initWithObjects:[NSNumber numberWithFloat:minSize],[NSNumber numberWithFloat:halfSize],[NSNumber numberWithFloat:maxSize], nil]; 
-(void)changeSizeLabels{
    NSArray *sizeArray = [NSArray arrayWithArray:[self defineSizeValueLabels]];
    [maxSizeLabel setStringValue:[NSString stringWithFormat:@"%.f GB",[[sizeArray objectAtIndex:2] floatValue]]];
    [halfSizeLabel setStringValue:[NSString stringWithFormat:@"%.f GB",[[sizeArray objectAtIndex:1] floatValue]]];
    [minSizeLabel setStringValue:[NSString stringWithFormat:@"%.1f GB",[[sizeArray objectAtIndex:0] floatValue]]];
@end

Remove the RamdiskSize allocation from applicationDidFinishLaunching and add an awakeFromNib method to RamdiskSize.m to alter the labels.

Similar Messages

  • I not read label text color

    Dear Support,
    I am legally-blind and deaf, I bought ipad3 last month, I setup enabled White & Black and Triple-click is Black/White, I make and save solid black.jpg and solid white.jpg in ipad3, click wallpaper done...  start Lock  see black (good) then home, i see icon with white text and black background, good,  I click setting, mail, message are white background, I can't read I press triple-click switch black, I see it when finish press Home back white background, I press triple-click back black, I am not happy lot of triple-click, I am worries button will be broke soon.. but I got idea change white.jpg,  switch to black background, i press lock good, then home is bad, black background is ok but I not read white text on icon, it is blank, I press seeting, mail, message are good   no need triple-click  but I need how fix change color on label text label ?
    I search website I type "change label text icon", I saw many had it but it is jailbreak, I don't want it, because void of warranty
    any fix label text icon?
    help me?
    Thank out
    Richard

    I am pretty sure that I understand what you are trying to do, but I do not know of any way that you can change the color of the text on the app icons. Your only options are black on white - or the standard white text labels.
    As you have discovered, there is no way to change how the iOS works without modification of the device and you know that voids the warranty and it could cause even more problems down the road.
    I'm sorry, but I think that you will have to take a chance on the triple clicks. The iPad does come with a one year warranty and Apple has built the Accessibility feature into the iPad knowing that the triple click will be used by people such as yourself. I would not hesitate to use the feature.

  • When I click "Buy Now" in iPhoto's book I get the following message: Your book appears to have default text that has not been edited. Printed books will not include this text. Do you want to continue?"

    When I click "Buy Now" in iPhoto's book I get the following message: "Your book appears to have default text that has not been edited. Printed books will not include this text. Do you want to continue?"
    How do I proceed?  How do I identify which is "default text?"

    What version of iPhoto are you using?
    Go thru each page, check the layout to see if there's a text box included on the page and make sure there is text in that text box.  If not it may show the "holding" text like this:
    If you don't want to change the page layout to one that only has photos and no text boxes just select that holding text and put a space in its place.
    OT

  • View only works in one direction,will not change when I turn the phone

    view only works in one direction,will not change when I turn the phone

    Is the rotate lock on?
    http://appletoolbox.com/2013/03/iphone-ipad-or-ipod-screen-will-not-rotate-fix/

  • Finder Icon will not change! Please help!

    I have been customizing the look of of my dockbar on my imac by giving all of my apps new ios 7 style icons.
    Yesterday I changed my Finder icon with no problem at all by going to:
    System→Library→Core Services→(right click 'Dock'→Show Package Contents)→Contents→Resources.
    And replacing the two png files (finder.png) and ([email protected]) with my new images. Yesterday I did this all perfectly fine and it changed to my new icon.
    However today I found a better finder icon and decided to change it again to this new version. However what ever I try it will not change to this new icon.
    I have followed the exact same steps as before, I have replaced my two png files from yesterday with my new ones and I have checked and re-checked that I am naming the files correctly, and that they are the right format etc.
    I have even deleted my original icons that I changed it to yesterday and emptied them from the trash but it is still there even after restarting and shutting down and rebooting.
    I have also tried going to terminal and typing 'killall Dock', it still returns with the same icon that I changed it to yesterday, even though I have deleted them from my hard drive.
    Please help me this is so frustrating and have wasted many many hours on this.
    (I am on mavericks btw)

    (I am on mavericks btw)
    iMac, OS X Mountain Lion (10.8.4)
    Then, update your profile/product info. BTW, I have nothing for the icon problem.

  • Statistic report with figures that will not change when rerun months later

    Hi,
    Is there any good practices that we can follow to create statistic reports with figures that will not change even when rerun after few months later?
    My scenario is my statistic report is generated based on data that is "alive" which means the record will get change after a period of time. So, if you generate the statistic report in for January 2006 in the month of January and regenerate in May for the January 2006 statistic, the figure is different. But what I want is to be able to get the same figures.
    I know in this case looks like we need some sort of summary tables, so posting this to get advice on the best way to design such summary tables. Please comment if there is other ways of doing it.
    Summary tables may work for statistic report, but how to support detail report listing where the records are required to be the same when it was generated few months ago.
    Please advise.
    Thank you.

    What happens, when you execute a report today is the following: a select statement is fired at the data base and the result set is displayed in the report. The data can change after the moment you launched your report. What you could do to keep the result set the same, is implementing a user parameter that fills your date discriminator.

  • HT201401 4s with latest software update will not power off, text will only vibrate, iPod only works with earphones. When I sync it with iTunes it works until power save mode starts, then back to not powering down, making text sounds, or playing iPod out l

    4s with latest software update will not power off, text will only vibrate, iPod only works with earphones. When I sync it with iTunes it works until power save mode starts, then back to not powering down, making text sounds, or playing iPod out loud.

    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414
    If you try all these steps and you still have issues... Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • When using spotlight search on my 5s it will not show past text messages that haven't even been deleted even if I type a specific word that I know is in a message I want to search for. I have message search turned on in the spotlight settings.

    When using spotlight search my phone will not show all text messages with a common word even though I have not deleted any messages from my phone and I have the message search turned on in settings under spotlight search. The search only shows the messages that are recent within the past day or so. Why won't it show the other messages when I search for them even using a specific word that I know was in the message I'm searching for.

    Hello ChiomaM,
    It sounds like you are not getting notifications for new text messages that are coming in, and you must manually check the app. I recommend checking the Notification settings to see if they are configured correctly:
    iOS: Understanding notifications
    http://support.apple.com/kb/ht3576
    iOS apps can provide three types of notifications:
    Sounds: An audible alert plays.
    Alerts/Banners: An alert or banner appears on the screen.
    Badges: An image or number appears on the application icon.
    You can view which apps provide notifications and adjust notification settings using Settings > Notification Center. For additional information, refer to the user guide for your device.
    Thank you for using Apple Support Communities.
    Regards,
    Sterling

  • In the advanced tab of languages and Region the time and date formats will not change

    For a certian Application I am using I need to change the format of the Time and Date. I had no problems in Mountain Lion. In the advanced tab of languages and Region the time and date formats will not change. I need the date format to read as 01/01/14 and time format to read 13:00. As I said this was easily done in Mountain Lion and all previous Apple OS. I suspect it's an issue with in the OS.

    You're right, it has been that way for a long time. I've never bothered reporting it as a bug since it's simple enough to deal with, but reporting it would be a reasonable thing to do.

  • External Hyperlinks Will Not Change after Publishing

    Hi - I'm running the most up to date iWeb and trying to publish external hyperlinks that will not change no matter what I do. They do not overlap, there is no image blocking them, and I have checked and rechecked that they work on iWeb perfectly. I have tried saving each update individually with the inspector, publishing each update individually, re-entering each url then tab or enter - basically everthing suggested on these forums. The site is scullyfilm.com and the external links are to my pages on my squarespace site.
    Any ideas?

    It's very simple to do and it's virtually impossible to do it wrong.
    Here's how I did it.
    Went to Squarespace :
    http://scullyfilm.squarespace.com/
    Right-clicked a link and copied it :
    In iWeb, selected a button and made it a hyperlink. iWeb automagically places the copied link in the URL field :
    Repeated for other 3 links.
    There's currently ONE hyperlink on your page (last updated 20140113) :
    http://scullyfilm.com/scullyfilm/HOME.html
    and it links to :
    http://scullyfilm.com/casting/
    which does not exist.

  • When I click Buy Book this appears our book appears to have default text that has not been edited. Printed books will not include this text. Do you want to continue? will the text I have sellected still be ok or will the book have missing text help Pleas?

    I just spent 3 days creating a book [32 pages], with photos and text but when I click Buy Book In iPhoto this appears>
    Our book appears to have default text that has not been edited. Printed books will not include this text. Do you want to continue?
    My question is will the text I have sellected to use still be ok, am I safe to continue and buy or will the book have missing text ?
    The book is for special birtday in 2 weeks time  Please Help.G
    <Email Edited by Host>

    Yes, you're safe to continue.  That means that there are text boxes that you did not put any text into and they contain the holding text which will not be printed.  That text is shown in a light grayt and is in Latin.  Normally you can just put a space in the text box to replace the holding text so as not to get that warning message.
    Before ordering the book proof the book according to this Apple document: iPhoto, Aperture: Previewing an order in iPhoto or Aperture. Check the pdf file for any missing text or photos and any warning indicators in the text boxes indicating that some of the text has exceeded the space allotted in the text box.
    Keep the pdf file to compare with the printed copy when you reciive it.
    OT

  • My Ipod touch will not change songs or shuffle

    My I pod touch will not change or shuffle songs.  Everything else seems to be working correctly.  Any suggestions? 

    While playing any song on your iPod, tap the artwork to bring up the scrubber bar and additional controls. On the left hand side is a option for repeat. You want to make sure this icon is white (meaning it is set to Off). If it isn't tap it either one or two times to change its current setting.
    Any luck there?
    B-rock

  • Why does the Iphone4 freeze up after downloading the IOS7.6 patch showing an ITUNE icon? The phone will not change screens for 4 hours.

    Why does the Iphone4 freeze up after downloading the IOS7.6 patch showing an ITUNE icon? The phone will not change screens for 4 hours.
    I Turn it off/on  and nothing changes.

    Hello bigboza,
    Thank you for using Apple Support Communities.
    For more information, take a look at:
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/ts3281
    If the device remains unresponsive or does not turn on (or power on), reset your device.
    If there is no video or if the screen remains black, verify that the device has enough charge to turn on:
    If you are using an iPad, ensure that it's connected to the USB Power Adapter supplied with the device.
    Let it charge for at least twenty minutes, then see if it starts normally.
    If there is no image on the screen, press the Sleep/Wake button to attempt to wake the device.
    If the screen displays a red battery icon, continue charging the device until the battery is fully charged. Learn more about charging iPhone and iPod touch, or iPad.
    If the above steps do not resolve the issue, or the if the screen remains black or shows a persistent Apple logo, try restoring with iTunes:
    Connect the device to your computer and open iTunes.
    If the device appears in iTunes, select and click Restore on the Summary pane. Learn more aboutrestoring iOS software.
    Have a nice day,
    Mario

  • How can I fix the text in my photo book that reads"your default text had not been edited. Printed books will not include this text?"

    How can I fix the text in my photo book that reads"your default text had not been edited. Printed books will not include this text?"

    You will get this warning, if your book includes textboxes that still include the default text, like "Insert Title". You need to find these boxes and add your own text.  Look for boxes like this:
    Make a PDF-preview of your book and look, where the preview differs from what you are seeing in iPhoto.
    iPhoto, Aperture: Previewing an order in iPhoto or Aperture

  • Air App will not read local text file using openAsync/readUTFBytes on user (non-admin) mode

    I am running an Air App I did for the desktop, from the actual installed executable already deployed in the machine (Not from Flash Pro / Flex dev. environment). For some reason the app will not read a text file stored in the same application folder unless I run my app as administrator from the OS.
    When I run the app as admin, or within the development environment it works fine. Maybe this is related to some security issue? I read the adobe air documentation, and this should work...
    I am using openAsync/readUTFBytes on user as shown here:
    var continueGamesConnection:FileStream();
    var continueFile:File = new File(File.applicationDirectory.resolvePath("continueGames.txt").nativePath.toString()); 
    continueGamesConnection.addEventListener(Event.COMPLETE, openSavedGames);
    continueGamesConnection.openAsync(continueFile, FileMode.UPDATE); 
    function openSavedGames(event:Event):void
         continueGamesConnection.removeEventListener(Event.COMPLETE, openSavedGames);
         var content:URLVariables = new URLVariables();
         var loadedContent:String = new String();
         loadedContent = continueGamesConnection.readUTFBytes(continueGamesConnection.bytesAvailable);
         content.decode(loadedContent); 
         variableX = content. variableX
         //etc, etc. 
         continueGamesConnection.close();
    By the way, I have also, tried using FileMode.READ, and others, and it still gives me the same problem. Only works if ran on admin mode or from the dev. environment.
    It's very frustrating, I tried reading other posts without any luck... What solutions do people use for this kind of problem?
    I have seen that you can set the app to run as admin somehow, and I guess that could work. However, this should work just fine, since it doesn't seem to violate any of the security APIs of Air. Seems like an overkill. But even so, how do I do that?
    You help is greatly appreciated!

    Thanks kglad.com. I will try this and see if it works. Can you check my code a bit to see if it's right?
    var continueFile:File = new File(File.applicationStorageDirectory.resolvePath("savedgames/continueGames.txt").nativePath.toString());
    Does this look right to work across all desktop OS?

Maybe you are looking for