Search Results

Search found 1263 results on 51 pages for 'retain'.

Page 16/51 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Why are controls (null) in awakeFromNib?

    - by fuzzygoat
    This is a follow on from another question regarding why I could not set UIControls in awakeFromNib. The answer to that is that as you can see below the controls are nil in the awakeFromNib, although they are initialised to the correct objects by the time we get to viewDidLoad. I setup the view the same as I always do, should I be doing something different to access them here, the xib(nib) was designed and saved with the current version of Image Builder. CODE: @interface iPhone_TEST_AwakeFromNibViewController : UIViewController { UILabel *myLabel; UIImageView *myView; } @property(nonatomic, retain)IBOutlet UILabel *myLabel; @property(nonatomic, retain)IBOutlet UIImageView *myView; @end . @synthesize myLabel; @synthesize myView; -(void)awakeFromNib { NSLog(@"awakeFromNib ..."); NSLog(@"myLabel: %@", [myLabel class]); NSLog(@"myView : %@", [myView class]); //[myLabel setText:@"AWAKE"]; [super awakeFromNib]; } -(void)viewDidLoad { NSLog(@"viewDidLoad ..."); NSLog(@"myLabel: %@", [myLabel class]); NSLog(@"myView : %@", [myView class]); //[myLabel setText:@"VIEW"]; [super viewDidLoad]; } OUTPUT: awakeFromNib ... myLabel: (null) myView : (null) viewDidLoad ... myLabel: UILabel myLabel: UIImageView Much appreciated ... gary

    Read the article

  • Setting up a view to draw to in Objective-C (iPhone) ?

    - by Johannes Jensen
    Okay, so, I'm all new to iPhone and stuff, but I'm not even at programming, I have many years of experience with ActionScript 2.0 and 3.0, I want to set up a view, that I can also pass variables to. The view is gonna draw everything with Quartz. I tried to make another game where I tried to add a pointer to a NSMutableArray to the view class, but it didn't work cause I didn't know how to store an actual class. I wanted to do like: [myView setNeedsDisplay]; but I had to do [(View*)self.view setNeedsDisplay]; didn't really work out in the end... Okay, so now I got: - (void) viewDidLoad { [super viewDidLoad]; viewClass = [[View class] retain]; gameView = [[[viewClass alloc] initWithFrame: CGRectZero] retain]; [gameView setNeedsDisplay]; } This is in my drawInContext:context, which is fired by drawRect: Also, my drawRect does [self drawInContext: UIGraphicsGetCurrentContext()]; CGContextSetStrokeColorWithColor(context, [[UIColor blackColor] CGColor]); CGContextSetLineWidth(context, 3.0); CGContextSetLineCap(context, kCGLineCapRound); CGContextSetLineJoin(context, kCGLineJoinRound); CGMutablePathRef aPath = CGPathCreateMutable(); CGPathMoveToPoint(aPath, nil, 5, 5); CGPathAddLineToPoint(aPath, nil, 45, 43); CGContextAddPath(context, aPath); CGContextStrokePath(context); Nothing happens. Help? Oh yeah, I get this error: : invalid context for each time I use those functions. :[ Thanks!

    Read the article

  • Objective-C Definedness

    - by Dan Ray
    This is an agonizingly rookie question, but here I am learning a new language and framework, and I'm trying to answer the question "What is Truth?" as pertains to Obj-C. I'm trying to lazy-load images across the network. I have a data class called Event that has properties including: @property (nonatomic, retain) UIImage image; @property (nonatomic, retain) UIImage thumbnail; in my AppDelegate, I fetch up a bunch of data about my events (this is an app that shows local arts event listings), and pre-sets each event.image to my default "no-image.png". Then in the UITableViewController where I view these things, I do: if (thisEvent.image == NULL) { NSLog(@"Going for this item's image"); UIImage *tempImage = [UIImage imageWithData:[NSData dataWithContentsOfURL: [NSURL URLWithString: [NSString stringWithFormat: @"http://www.mysite.com/content_elements/%@_image_1.jpg", thisEvent.guid]]]]; thisEvent.image = tempImage; } We never get that NSLog call. Testing thisEvent.image for NULLness isn't the thing. I've tried == nil as well, but that also doesn't work.

    Read the article

  • Objective C Naming Convention for an object that owns itself

    - by Ed Marty
    With the latest releases of XCode that contain static analyzers, some of my objects are throwing getting analyzer issues reported. Specifically, I have an object that owns itself and is responsible for releasing itself, but should also be returned to the caller and possibly retained there manually. If I have a method like + (Foo) newFoo the analyzer sees the word New and reports an issue in the caller saying that newFoo is expected to return an object with retain +1, and it isn't being released anywhere. If I name it + (Foo) getFoo the analyzer reports an issue in that method, saying there's a potential leak because it's not deallocated before returning. My class basically looks like this: + (Foo *) newFoo { Foo *myFoo = [[[Foo new] retain] autorelease]; [myFoo performSelectorInBackground:@selector(bar) withObject:nil]; return myFoo; } - (void) bar { //Do something that might take awhile [self release]; } The object owns itself and when its done, will release itself, but there's nowhere that it's being stored, so the static analyzer sees it as a leak somewhere. Is there some naming or coding convention to help?

    Read the article

  • [iphone] method created in a seperate class returns "out of scope"

    - by Dror Sabbag
    Hey, I have created a Class (subclass of NSObject) which will hold all my SQLs/dbConnections etc.. in a seperate viewcontroller, i have instantiated the SQL's class and performed some actions, all went trough OK. but. one of my methods in the SQL's class is a method defined as follows: -(NSString *)queryTable:(NSUInteger *)fieldnum //query from db, and assign the field value into "fieldName" dbEntity = fieldName; [fieldName release]; } sqlite3_finalize(statement); } return dbEntity; } dbEntity is defined as NSString, and i have set it as a nonatoimc-retain property @property (nonatomic,retain) NSString *dbEntity; when ever i call this method out from my viewController and debug step by step, i see that the method is running, it is quering from the db as expected, but when it passes the value into dbEntity the values in dbEntity are suddenly "out of scope" that is... if i browse this specific action: dbEntity = fieldName; i can see values inside fieldName, but see "out of scope" in dbEntity. Why is that?!? what is wrong with dbEntity definitions? Any help will be appriciated.

    Read the article

  • How do I populate an NSMutableArray in one class with another object?

    - by AngeloS
    Hello, I know this is a simple answer, but I can't seem to find the solution. I created an object in its own class and I am trying to populate it with data from another class. For simple data types like NSString, I have no problem, but when trying make an NSMutableArray equal to another NSMutableArray or when I try to populate a NSMutableArray with another objects (like strings), I keep getting exception errors... Here is the object I am trying to populate: #import <Foundation/Foundation.h> @interface RSSFeedList : NSObject { NSString *subject; NSMutableArray *rssfeedDetail; } @property (nonatomic, retain) NSString *subject; @property (nonatomic, retain) NSMutableArray *rssfeedDetail; @end This is how I was able to populate the NSString 'subject' in another class: rssFeedList.subject = @"test"; However, if I follow similar convention within that same class with respect to an Array, it throws an exception: rssFeedList.rssfeedDetail = rssItemDetailArray; Where rssItemDetailArray is a NSMutableArray that I have built in the same class. I have also tried to add items (i tried strings for testing) to the NSMutableArray directly like so to no avail: [rssFeedList.rssfeedDetail addObject:@"test"]; Any ideas?? Thanks in advance!!

    Read the article

  • How do you get and set a class property across multiple functions in Objective-C?

    - by editor
    Following up on this question about sharing objects between classes, I now need to figure out how to share the objects across various functions in a class. First, the setup: In my App Delegate I load menu information from JSON into a NSMutableDictionary and message that through to a view controller using a function called initWithData. I need to use this dictionary to populate a new Table View, which has methods like numberOfRowsInSection and cellForRowAtIndexPath. I'd like to use the dictionary count to return numberOfRowsInSection and info in the dictionary to populate each cell. Unfortunately, my code never gets beyond the init stage and the dictionary is empty so numberOfRowsInSection always returns zero. I thought I could create a class property, synthesize it and then set it. But it doesn't seem to want to retain the property's value. What am I doing wrong here? In the header .h: @interface FirstViewController:UIViewController <UITableViewDataSource, UITableViewDelegate, UITabBarControllerDelegate> { NSMutableDictionary *sectorDictionary; NSInteger sectorCount; } @property (nonatomic, retain) NSMutableDictionary *sectorDictionary; - (id)initWithData:(NSMutableDictionary*)data; @end in the implementation .m: - (id) testFunction:(NSMutableDictionary*)dictionary { NSLog(@"Count #1: %d", [dictionary count]); return nil; } - (id)initWithData:(NSMutableDictionary *)data { if (!(self=[super init])) { return nil; } [self testFunction:data]; // this is where I'd like to set a retained property self.sectorDictionary = data; return nil; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSLog(@"Count #2: %d", [self.sectorDictionary count]); return [self.sectorDictionary count]; } Output from NSLog: 2010-05-04 23:00:06.255 JSONApp[15890:207] Count #1: 9 2010-05-04 23:00:06.259 JSONApp[15890:207] Count #2: 0

    Read the article

  • LLVM/Clang bug found in convenience method and NSClassFromString(...) alloc/release

    - by pirags
    I am analyzing Objective-C iPhone project with LLVM/Clang static analyzer. I keep getting two reported bugs, but I am pretty sure that the code is correct. 1) Convenience method. + (UILabel *)simpleLabel { UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 10, 200, 25)]; label.adjustsFontSizeToFitWidth = YES; [label autorelease]; // Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected. return label; } 2) The [NSClassFromString(...) alloc] returns retainCount + 1. Am I right? Class detailsViewControllerClass = NSClassFromString(self.detailsViewControllerName); UIViewController *detailsViewController = [[detailsViewControllerClass alloc] performSelector:@selector(initWithAdditive:) withObject:additive]; [self.parentController.navigationController pushViewController:detailsViewController animated:YES]; [detailsViewController release]; // Incorrect decrement of the reference count of an object is not owned... Are these some Clang issues or I am totally mistaken in these both cases?

    Read the article

  • My UITextView delegate method doesn't respond

    - by user611967
    Hi guys. I would like to start we that i'm not a very good english speaker, so excuse me if something is wrong. So I have this code header file : import @interface macViewController : UIViewController { UINavigationItem *navItem; UITextView *iTextView; } @property (nonatomic, retain) IBOutlet UINavigationItem *navItem; @property (nonatomic, retain) IBOutlet UITextView *iTextView; (IBAction) btnClicked; @end implementation file : import "macViewController.h" @implementation macViewController @synthesize navItem, iTextView; (IBAction) btnClicked { if (self.editing == YES) { self.editing = NO; [iTextView resignFirstResponder]; UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Data Saved" message:@"Your data was saved" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; } else { self.editing = YES; [iTextView becomeFirstResponder]; } NSLog(@"works"); self.navItem.rightBarButtonItem = self.editButtonItem; self.navItem.rightBarButtonItem.action = @selector(btnClicked); } (void) textViewDidChangeUITextView *)textView { NSLog(@"works"); } So like you guess it's a view based app wich when i tap Edit button the keyboard pops-up then i press Done button and keyboard disappear and appear a alert view. SO I WANTED TO MAKE THEN I TOUCH THE TEXTVIEW, EDIT BUTTON TO BECOME DONE BUTTON ... THE PROBLEM IS THAT THE METHOD I DELEGATE TO IT DOESN'T RESPOND ... (USING CONSOLE I SAW THAT NOTHING HAPPENS) ... I TRIED DIFFERENT CODE BUT ALL = 0 ... PLEASE HELP I'M NEW ...

    Read the article

  • Specifying an additional Applications directory on Mac OS X

    - by 341008
    Is there any way I can specify an additional Applications directory. I basically want to keep the applications that come with Mac OS X in the default Applications directory, but, install all third-party software to a different directory which is in a separate partition. I want to retain all advantages of the actual Applications directory such as the one where copying files from a .dmg to the Applications folder installs software.

    Read the article

  • Connecting to Outlook Web (OWA) via a desktop client

    - by mgroves
    I'm having all kinds of timeout problem with the web-based client for Outlook Online (microsoftonline.com), and I'd like to use something like Live Mail to connect instead. So, can I use Live Mail to do that? If so, how do I configure it? If I can't use Live Mail, are there any desktop clients that can connect (I'd like to retain access to the calendar, etc)?

    Read the article

  • Windows 7 search - sucky?

    - by Scott Evernden
    Is there an alternative to trying to remember all the advanced search options? Like an actual GUI as we had for windows XP? As powerful as Windows Search apparently is, I cannot possibly remember all the options available. How is a mere mortal like my Dad supposed to understand and retain all this? I get the shakes every time i need to find something on Win 7. Anyone have some relief?

    Read the article

  • Reinstalling Windows XP over openSUSE [closed]

    - by Ashish
    I had installed Windows XP and after that openSUSE. If i want to retain only Windows XP on my system, if I reinstall Windows XP but it gives problem of partition error. If I reinstall openSUSE then grub loader shows Windows which starts setup again which was remained after restart.

    Read the article

  • black backgrounds appear grey on gnome-terminal

    - by Martin DeMello
    Running gnome under Ubuntu Lucid $ env | grep TERM TERM=xterm COLORTERM=gnome-terminal I had to edit both my .muttrc and my vim colorscheme to change the background color from black to none in order to get a proper black background (or, more accurately, to retain the terminal's default black background). Setting it to black resulted in a dark grey background. This only happens with gnome-terminal; konsole, xterm and rxvt are fine.

    Read the article

  • How to boot Linux and Windows - Windows as Default OS

    - by lions_leash
    I have a dual boot system that works great. I have Ubuntu and XP 64 on one disk and XP on another disk. The Linux boot loader asks me which system to boot, but if I reboot and forget to hit a button, it goes to Linux by default. I would like to boot to XP by default, but somehow retain the option of choosing.

    Read the article

  • Changing my PC's motherboard

    - by Shyam
    I have a Asus A7N266 motherboard currently with a Athlon XP 1.8GHz processor that I assembled in 2002. The Video RAM for this is just 32 MB. I would like to upgrade my motherboard and retain the Processor. Is that advisable? If so, could you also suggest a good motherboard that has a better VGA capability?

    Read the article

  • numeric keypad functions on compact or tenkeyless keyboard

    - by RedGrittyBrick
    I am purchasing a keyboard without a numeric pad (a Cooler Master Storm Rapid but my question probably applies to any keyboard without a numeric pad) I very occasionally use the numeric pad on my current keyboard, in conjunction with the Alt key, to enter special characters. If the keyboard does not make any special provision for this (no obvious keypad overlay on main section of keyboard, nothing on this subject in user-guide) - is there any way to retain this Alt+nnn capability under Windows-7?

    Read the article

  • Software RAID for several HDs which retains files on each HD

    - by Fuxi
    Is there some kind of software/driver that would enable me to create one big volume out of several hard disks but retain the file structure on each HD? This would be in case where one hard disk crashes and only data on that HD will be lost. Windows 7 enables me to do that but in case one HD breaks all data will be lost.

    Read the article

  • Does moving a file outside NTFS loose data in alternate data streams?

    - by jay
    I have a lot of files on machine running Windows Server 2008 which I wanted to move to a Fedora machine. How can I keep the attributes stored in, for example, media files (date taken, rating, length, etc) while transfering it to outside the realm of NTFS's Alternate Data Streams. I'm aware that similar metadata exists in other file systems, but what happens when you move these files? And what's the best way to retain them in other file systems?

    Read the article

  • Redirecting http to https (iis 7)

    - by Simon
    Our server redirects http://ourdomain.com/anything to http://ourdomain.com Is is possible to get it to redirect and retain the anything part? ie. http://ourdomain.com/cat/dog to https://ourdomain.com/cat/dog

    Read the article

  • Does moving a file outside NTFS loose data in alertnate data streams?

    - by jay
    I have a lot of files on machine running Windows Server 2008 which I wanted to move to a Fedora machine. How can I keep the attributes stored in, for example, media files (date taken, rating, length, etc) while transfering it to outside the realm of NTFS's Alternate Data Streams. I'm aware that similar metadata exists in other file systems, but what happens when you move these files? And what's the best way to retain them in other file systems?

    Read the article

  • Is it perfectly safe to install grub bootloader on regular partition?

    - by Flint
    One of the methods to do dual booting Windows with Linux OS is by installing grub boot loader onto Linux partition so you can retain Windows boot loader and let Windows handles the dual booting process. What's the odd that grub bootloader could partially overwrite the data at the beginning of the Linux partition and corrupt the file? Does grub actually check if there's a data at the beginning of the partition and move it to other location on the partition before writing its bootloader?

    Read the article

  • is there a tool that will let me take 'functional screenshots'?

    - by subpixel
    It's one thing to grab screenshots of web sites and return to them for design and interface ideas and inspiration. But increasingly I've found that when I want to examine something that previously caught my eye, the actual web site has since been altered, so I can no longer learn from the code. I wonder: is there a tool available that would allow me to save interfaces in a format that would retain the html/css? Thanks

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >