Search Results

Search found 1559 results on 63 pages for 'nslog'.

Page 18/63 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • NSNumberFormatter weirdness with NSNumberFormatterPercentStyle

    - by rein
    Hi, I need to parse some text in a UITextField and turn it into a percentage. Ideally, I'd like the user to either type something like 12 or 12% into the text field and have that be parsed into a number as a percentage. Here's what's weird. The number formatter seems to not like 12 and seems to divide 12% by 10000 instead of 100: NSNumberFormatter *formatter = [[[NSNumberFormatter alloc] init] autorelease]; [formatter setNumberStyle:NSNumberFormatterPercentStyle]; NSNumber *n1 = [formatter numberFromString:@"12"]; NSNumber *n2 = [formatter numberFromString:@"12%"]; NSLog(@"n1 = %@", n1); // n1 = (null) NSLog(@"n2 = %@", n2); // n2 = 0.0012 How do I get the formatter to return 0.12 as expected? EDIT: it seems to only happen if the formatter fails first. If the formatter does not fail it returns 0.12 as expected. Strange.

    Read the article

  • Insert new relationship data in core data

    - by michael
    Hoping someone can shed some light on what I might be doing wrong here. Trying to add an "event" to a list of events, represented by a one to many (inverse) relationship: MyEvents <--- Event This is the code: MyEvents *myEvents = (MyEvents *)[NSEntityDescription insertNewObjectForEntityForName:@"MyEvents" inManagedObjectContext:context]; NSLog(@"MYEVENTS: %@", myEvents); NSLog(@"EVENT: %@", event); [myEvents addEventObject:event]; My context is fine, and both the myEvents and event print perfectly valid information. When I try to add the event that I have (which is passed into this view controller, having been retrieved from core data previously) with this code [myEvents addEventObject:event]; It falls over with *** -[NSComparisonPredicate evaluateWithObject:]: message sent to deallocated instance MyEvents and Event are just the default generated code. MyEvents contains only the relationship to event. Thanks.

    Read the article

  • How to handle float values in a plist

    - by Banjer
    I'm reading in a plist from a web server, generated with some php. When I read that into an NSArray in my iphone app, and then spit the NSArray out with NSLog to check it out, I see that the float values are treated as strings. I would like the "distance" values to be treated as numeric and not strings. This plist is displayed in a table view where it can be sorted by distance, but the problem is is distance is sorted as a string, so I get some funny sorting results. Can I convert the distance values to float from string in the NSArray? Or maybe theres a simpler solution like tweaking the plist definition, or maybe something in the NSMutableURLRequest code? My plist looks like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>name</key> <string>Pizza Joint</string> <key>distance</key> <string>2.1</string> </dict> <dict> <key>name</key> <string>Burger Kang</string> <key>distance</key> <string>5</string> </dict> </array> </plist> After reading it into an NSArray, it looks like this per NSLog: result: ( { distance = "2.1"; name = "Pizza Joint"; }, { distance = 5; name = "Burger Kang"; } ) Here is the Objective-C code that retrieves the plist: // Set up url request // postData and postLength are left out, but I can post in this question if needed. NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:@"http://mysite.com/get_plist.php"]]; [request setHTTPMethod:@"POST"]; [request setValue:postLength forHTTPHeaderField:@"Content-Length"]; [request setValue:@"application/x-www-form-urlencoded charset=utf-8" forHTTPHeaderField:@"Content-Type"]; [request setHTTPBody:postData]; NSError *error; NSURLResponse *response; NSData *result = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSString *string = [[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding]; // libraryContent is an NSArray self.libraryContent = [string propertyList]; NSLog(@"result: %@", self.libraryContent);

    Read the article

  • I'm trying to build a to-do-list application in Objective C but coming up short.

    - by lampShade
    I'm getting this error: -[NSCFArray insertObject:atIndex:]: attempt to insert nil Here is the .m file: /* IBOutlet NSTextField *textField; IBOutlet NSTabView *tableView; IBOutlet NSButton *button; NSMutableArray *myArray; */ #import "AppController.h" @implementation AppController -(IBAction)addNewItem:(id)sender { myArray = [[NSMutableArray alloc]init]; tableView = [[NSTableView alloc] init]; [tableView setDataSource:self]; [textField stringValue]; NSString *string = [[NSString alloc] init]; string = [textField stringValue]; [myArray addObject:string]; NSLog(@"%d",[myArray count]); NSLog(@"%@",string); } - (int)numberOfRowsInTableView:(NSTableView *)aTableView { return [myArray count]; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { //NSString *data = [myArray objectAtIndex:rowIndex]; return [myArray objectAtIndex:rowIndex]; } @end

    Read the article

  • Program received signal from GDB: EXC_BAD_ACCESS

    - by user577185
    Well, I'm starting development on the Mac OS X this code that you'll see is in a book that I bought, really basic like Chapter 3. And I can't run it. PLEASE HELP ME: C301.m : #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { if (argc == 1) { NSLog (@"You need to provide a file name"); return -1; } FILE *wordFile = fopen("tmp/words.txt", "r"); char word[100]; while (fgets(word, 100, wordFile)) { word[strlen(word) - 1] = '\0'; NSLog(@"%s is %d characters long", word, strlen(word)); } fclose(wordFile); return 0; } //main The file is in its place. Thank you so much!

    Read the article

  • Error Playing video from server with MPMoviePlayerController

    - by skiria
    I try to play a video on the server with this code. I have a error. //Play the video from server - (IBAction)playVideo:(id)sender; { NSLog(@"URLVIDEO %@", aVideo.urlVideo); MPMoviePlayerController *VideoPlayer = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL URLWithString:aVideo.urlVideo]]; [VideoPlayer play]; } //Error on con console Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Content URL must not be nil.' aVideo.urlVideo is a NSString and it's correct when I copy the result on the NSLog on the browser.

    Read the article

  • Why is my NSMutableArray returning nill?

    - by lampShade
    I have a very simple task: add the contents of a textField to an NSMutableArray.The Problem is the array is returning nill. I believe that it has something to do with the fact that the array I'm using is declared as an instance variable. /* IBOutlet NSTextField *textField; IBOutlet NSTabView *tableView; IBOutlet NSButton *button; NSMutableArray *myArray; */ #import "AppController.h" @implementation AppController -(IBAction)addNewItem:(id)sender { NSString *string = [textField stringValue]; NSLog(@"%@",string); [myArray addObject:string]; NSLog(@"%d",[myArray count]);//this outputs 0 why is that? }

    Read the article

  • NSData to NSString by changing the value null is returned. I need you help

    - by kevin
    *cipher.h, cipher.m all code : http://watchitlater.com/blog/2010/02/java-and-iphone-aes-interoperability Cipher.m -(NSData *)encrypt:(NSData *)plainText{ return [self transform:KCCEncrypt data:plainText; } step1. Cipher *cipher = [[Cipher alloc]initWithKey:@"1234567890"]; NSData *input = [@"kevin" dataUsingEncoding:NSUTF8StringEncoding]; NSData *data = [cipher encrypt:input]; data variables NSLog print : <4d1c4d7f 1592718c fd588cec 84053e35 step2. NSString *changeVal = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; data variables NSLog print : null NSData to NSString by changing the value null is returned. By converting NSString NSURLConnection want to transfer. I need you help

    Read the article

  • question about CGAffineTransformTranslate

    - by www.ruu.cc
    CGRect rect1 = backgroundImageView.frame; NSLog(@"%f,%f,%f,%f",rect1.origin.x,rect1.origin.y,rect1.size.width,rect1.size.height); angle = -90.0; moveX = 0; moveY = 0.0; CGFloat degreesToRadians = M_PI * angle / 180.0; CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(degreesToRadians); landscapeTransform = CGAffineTransformTranslate( landscapeTransform, moveX, moveY ); [backgroundImageView setTransform:landscapeTransform]; rect1 = backgroundImageView.frame; NSLog(@"%f,%f,%f,%f",rect1.origin.x,rect1.origin.y,rect1.size.width,rect1.size.height); the debug message output: 0.000000,0.000000,320.000000,480.000000 -80.000000,80.000000,480.000000,320.000000 why does the (x,y) changes to (-80,80)?

    Read the article

  • Core Data fetchedresultscontroller question : what is "sections" for?

    - by Jake
    Hi, I'm trying to get to know Core Data (I'm a noob at iPhone development) and in order to do this I'm trying to get an object from the fetchedresultscontroller and NSlog it's name (a property of the object). I tried to do it like this: NSArray *ar = [NSArray arrayWithArray:[fetchedResultsController sections]]; Task *t = [ar objectAtIndex:0]; NSLog(@"%@", t.taskName); However, the app crashed with this error: the app crashes with the error Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[_NSDefaultSectionInfo taskName]: unrecognized selector sent to instance 0x3d1f670' I have since learned that you need to use the fetched objects property for this, but then what is sections for? Thanks for any help, sorry if this is a supremely stupid question. I've looked over the documentation but still don't understand.

    Read the article

  • Objectiveflickr set properties, more than one call

    - by user295944
    I cant to set Meta and set Location in ObjectiveFlickr if I do only one it works fine, but if I do both it only does the first one - (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didCompleteWithResponse:(NSDictionary *)inResponseDictionary { NSLog(@"%s %@ %@", PRETTY_FUNCTION, inRequest.sessionInfo, inResponseDictionary); if (inRequest.sessionInfo == kUploadImageStep) { snapPictureDescriptionLabel.text = @"Setting properties..."; NSLog(@"%@", inResponseDictionary); NSString *photoID = [[inResponseDictionary valueForKeyPath:@"photoid"] textContent]; flickrRequest.sessionInfo = kSetImagePropertiesStep; [flickrRequest callAPIMethodWithPOST:@"flickr.photos.setMeta" arguments:[NSDictionary dictionaryWithObjectsAndKeys:photoID, @"photo_id", @"Snap and Run", @"title", @"Uploaded from my iPhone/iPod Touch", @"description", nil]]; flickrRequest.sessionInfo = kSetImagePropertiesStep; [flickrRequest callAPIMethodWithPOST:@"flickr.photos.geo.setLocation" arguments:[NSDictionary dictionaryWithObjectsAndKeys:photoID, @"photo_id",@"34" ,@"lat",@"-118",@"lon", nil]]; } else if (inRequest.sessionInfo == kSetImagePropertiesStep) { [self updateUserInterface:nil]; snapPictureDescriptionLabel.text = @"Done"; [UIApplication sharedApplication].idleTimerDisabled = NO; } }

    Read the article

  • to print local xml file through NSData?

    - by senthilmuthu
    hi, i want to take some xml data from local path,and to parse,but when i use following code NSLog returns(content) different texts which is differed from xml file, how can i get exact xml data to check ,it consists correct xml data or not? any help please? when i parse , it returns nothing..i have saved the file as .xml and copied to local resource folder? NSString *xmlFilePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"samp.xml"]; NSString *xmlFileContents = [NSString stringWithContentsOfFile:xmlFilePath]; NSData *data = [NSData dataWithBytes:[xmlFileContents UTF8String] length:[xmlFileContents lengthOfBytesUsingEncoding: NSUTF8StringEncoding]]; NSString *content=[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSUTF8StringEncoding]; NSLog(@"%@",content);

    Read the article

  • Can't resignFirstResponder with UITextView

    - by Calvin L
    I have a UITextView. I implemented a navigationBar UIBarButtonItem to respond to a touch and resign the firstResponder for my UITextView. But, when the selector method is called, the keyboard doesn't get dismissed. I checked the UITextView's responder status with isFirstResponder and it returns YES. I also checked it with canResignFirstResponder and the return value is NO. I must be missing something here...why is it returning NO? I get that I can override canResignFirstResponder by subclassing UITextView, but I'd like to avoid that if possible. Here's a code snippet: - (void) commentCancelButtonTouched:(id)sender { NSLog(@"Cancel button touched"); [self.navigationBar popNavigationItemAnimated: NO]; if ([self.textInput.textView canResignFirstResponder] == NO) { NSLog(@"I don't want to resign!"); } [self.textInput.textView resignFirstResponder]; }

    Read the article

  • CFSocketConnectToAddress and unrecognized selector sent to instance

    - by madmik3
    Hello, I am somewhat new to iPhone dev and I have been getting unrecognized selector when I call CFSocketConnectToAddress in this code. I think it might be something basic that I am doing wrong. Any idea? this is the complete error I get. NSInvalidArgumentException unrecognized selector sent to instance 0x3922170 0x3922170 is the calling class. - (BOOL)connect { CFSocketRef mySocket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_DGRAM,IPPROTO_UDP, 0, socketCallback, NULL); @try { CFDataRef data = (CFDataRef)[_netService addresses]; CFSocketConnectToAddress(mySocket, data, 500); } @catch (NSException * e) { NSLog([e name]); NSLog([e reason]); } //char joke[] = "Why did the chicken cross the road?"; //CFSocketError err = CFSocketSendData(mySocket, joke, (strlen(joke)+1), 10); return true; } void socketCallback ( CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, const void *data, void *info) { }

    Read the article

  • MacRuby - CLLocation Properties Not Accessible

    - by Craig Williams
    Anyone know why this works in Objective-C but not in MacRuby? Objective-C Version: CLLocation *loc = [[CLLocation alloc] initWithLatitude:38.0 longitude:-122.0]; NSLog(@"Lat: %.2f", loc.coordinate.latitude); NSLog(@"Long: %.2f", loc.coordinate.longitude); [loc release]; // Results: // 2010-04-30 16:48:55.568 OCCoreLocationTest[70030:a0f] Lat: 38.00 // 2010-04-30 16:48:55.570 OCCoreLocationTest[70030:a0f] Long: -122.00 Here is the MacRuby version with results: loc = CLLocation.alloc.initWithLatitude(38.0, longitude:-122.0) puts loc.class # => CLLocation puts loc.description # => <+38.00000000, -122.00000000> +/- 0.00m (speed -1.00 mps / course -1.00) @ 2010-04-30 16:37:47 -0600 puts loc.respond_to?(:coordinate) # => true puts loc.coordinate.latitude # => Error: unrecognized runtime type `{?=dd}' (TypeError)

    Read the article

  • How do I set the current point in a CG graphics context?

    - by Joe
    When running the code below in the iphone simulator I get the error : CGContextClosePath: no current point. Why is the current point not being set? Or is the context not set to the correct state? CGContextBeginPath(ctx); CGMutablePathRef pathHolder; pathHolder = CGPathCreateMutable(); //move to point for the initial point NSLog(@"Drawing a state point %f, %f", [[holder.points objectAtIndex:0] floatValue], [[holder.points objectAtIndex:1] floatValue]); CGPathMoveToPoint(pathHolder, NULL, [[holder.points objectAtIndex:0] floatValue], [[holder.points objectAtIndex:1] floatValue]); for(int x = 2; x < [holder.points count] - 1; x += 2) { NSLog(@"Drawing a state point %f, %f", [[holder.points objectAtIndex:x] floatValue], [[holder.points objectAtIndex:(x+1)] floatValue]); CGPathAddLineToPoint(pathHolder, NULL, [[holder.points objectAtIndex:x] floatValue], [[holder.points objectAtIndex:(x+1)] floatValue]); } CGContextClosePath(ctx); CGContextFillPath(ctx);

    Read the article

  • Novocaine - How to loop file playback? (iOS)

    - by lppier
    I'm using Novocaine by alexbw Novocaine for my audio project. I'm playing around with the example code here for file reading. The file plays back with no problem. I would like to loop this recording with the gap between the loops - any suggestion as to how I can do so? Thanks. Pier. // AUDIO FILE READING OHHH YEAHHHH // ======================================== NSArray *pathComponents = [NSArray arrayWithObjects: [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject], @"testrecording.wav", nil]; NSURL *inputFileURL = [NSURL fileURLWithPathComponents:pathComponents]; NSLog(@"URL: %@", inputFileURL); fileReader = [[AudioFileReader alloc] initWithAudioFileURL:inputFileURL samplingRate:audioManager.samplingRate numChannels:audioManager.numOutputChannels]; [fileReader play]; [fileReader setCurrentTime:0.0]; //float duration = fileReader.getDuration; [audioManager setOutputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels) { [fileReader retrieveFreshAudio:data numFrames:numFrames numChannels:numChannels]; NSLog(@"Time: %f", [fileReader getCurrentTime]); }];

    Read the article

  • touchesBegan and other touch events not getting detected in UINavigationController

    - by SaltyNuts
    In short, I want to detect a touch on the navigation controller titlebar, but having trouble actually catching any touches at all! Everything is done without IB, if that makes a difference. My app delegate's .m file contains: MyViewController *viewController = [[MyViewController alloc] init]; navigationController = [[UINavigationController alloc] initWithRootViewController:viewController]; [window addSubview:navigationController.view]; There are a few other subviews added to this window in a way that overlays navigationController leaving only the navigation bar visible. MyViewController is a subclass of UIViewController and its .m file contains: - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { for (UITouch *touch in touches) { NSLog(@"ended\n"); } } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { for (UITouch *touch in touches) { NSLog(@"began\n"); } } I also tried putting these functions directly into app delegate's .m file, but the console remains blank. What am I doing wrong?

    Read the article

  • Presentmodalviewcontroller method problem with retain count

    - by Infinity
    Hello guys! I am trying to present a modal view controller. I have read the documentation, but something is strange. Here's my code: NSLog(@"rc: %d", [modalViewController retainCount]); UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:modalViewController]; [self presentModalViewController:navigationController animated:YES]; [navigationController release]; NSLog(@"rc: %d", [modalViewController retainCount]); And on the console, appears: rc: 2 rc: 24 And I think 24 is very strange... What do you thin? Why is this happening?

    Read the article

  • iPhone. UITableView and pushing view controller

    - by Jacek
    Hello. I have a working UITableView in my view controller. It is being successfully populated and seems to be fine. However, when I try using following function, new view is not loaded (function is called, I get output from NSLog): - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"asf"); [self.navigationController pushViewController:sendRequestFavoriteController animated:YES]; } What might be a problem? I get no compilation or debugging errors/warnings. Maybe UITabBar's navigation controller?

    Read the article

  • UITableViewCell is 1px shorter in didSelectRowAtIndexPath than cellForRowAtIndexPath

    - by Calvin L
    I have a UITableViewCell that I create in tableView:cellForRowAtIndexPath:. In that method I call: UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease]; NSLog(@"Cell height: %f", cell.contentView.frame.size.height); This gives me a return value of 44.000000. Then in my tableView:didSelectRowAtIndexPath: method, I call: UITableViewCell *cell = [tableView cellForRowAtIndexPath: indexPath]; NSLog(@"Cell height: %f", cell.contentView.frame.size.height); And this gives me a return value of 43.000000. Aren't they the same cell? What gives?

    Read the article

  • iphone calls both if and else at the same time?

    - by David Schiefer
    Hi, I need to determine what file type a file is and then perform a certain action for it. this seems to work fine for some types, however all media types such as videos and sound files get mixed up. I determine the file type by doing this: BOOL matchedMP3 = ([[rowValue pathExtension] isEqualToString:@"mp3"]); if (matchedMP3 == YES) { NSLog(@"Matched MP3"); } I do this for various file types and just define an "else" for all the others. Here's the problem though. The iPhone calls them both. Here's what the log reveals: 2010-05-11 18:51:12.421 Test [5113:207] Matched MP3 2010-05-11 18:51:12.449 Test [5113:207] Matched ELSE I've never seen anything like this before. This is my "matchedMP3" function: BOOL matchedMP3 = ([[rowValue pathExtension] isEqualToString:@"mp3"]); if (matchedMP3 == YES) { NSLog(@"Matched MP3"); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *manager = [NSFileManager defaultManager]; self.directoryContent = [manager directoryContentsAtPath:documentsDirectory]; NSString *errorMessage = [documentsDirectory stringByAppendingString:@"/"]; NSString *urlAddress = [errorMessage stringByAppendingString:rowValue]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:urlAddress]]; moviePlayer.movieControlMode = MPMovieControlModeDefault; moviePlayer.backgroundColor = [UIColor blackColor]; [moviePlayer play]; } and here's the else statement: else { NSLog(@"Matched ELSE"); [[NSUserDefaults standardUserDefaults] setObject:rowValue forKey:@"rowValue"]; NSString*rowValue = [[NSUserDefaults standardUserDefaults] objectForKey:@"rowValue"]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *manager = [NSFileManager defaultManager]; self.directoryContent = [manager directoryContentsAtPath:documentsDirectory]; NSString *errorMessage = [documentsDirectory stringByAppendingString:@"/"]; NSString *urlAddress = [errorMessage stringByAppendingString:rowValue]; webViewHeader.prompt = rowValue; [documentViewer setDelegate:self]; NSString *encodedString = [urlAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //Create a URL object. NSURL *url = [NSURL URLWithString:encodedString]; //URL Requst Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //Load the request in the UIWebView. [documentViewer loadRequest:requestObj]; [navigationController pushViewController:webView animated:YES]; } I can't see a reason why it wouldn't work. What happens is that both the webview and the MediaPlayer toggle their own player, so they overlap and play their sound/video a few secs apart from each other. Any help would be appreciated & thank for you taking the time to read through my code.

    Read the article

  • Calling UIGetScreenImage() on manually-spawned thread prints "_NSAutoreleaseNoPool():" message to lo

    - by jtrim
    This is the body of the selector that is specified in NSThread +detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget withObject:(id)anArgument NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; while (doIt) { if (doItForSure) { NSLog(@"checking"); doItForSure = NO; (void)gettimeofday(&start, NULL); /* do some stuff */ // the next line prints "_NSAutoreleaseNoPool():" message to the log CGImageRef screenImage = UIGetScreenImage(); /* do some other stuff */ (void)gettimeofday(&end, NULL); elapsed = ((double)(end.tv_sec) + (double)(end.tv_usec) / 1000000) - ((double)(start.tv_sec) + (double)(start.tv_usec) / 1000000); NSLog(@"Time elapsed: %e", elapsed); [pool drain]; } } [pool release]; Even with the autorelease pool present, I get this printed to the log when I call UIGetScreenImage(): 2010-05-03 11:39:04.588 ProjectName[763:5903] *** _NSAutoreleaseNoPool(): Object 0x15a2e0 of class NSCFNumber autoreleased with no pool in place - just leaking Has anyone else seen this with UIGetScreenImage() on a separate thread?

    Read the article

  • problem in adding data to an array in Objective-C!!!

    - by anurag
    I am grappling with adding an NSData object to a NSMutable array. The code is executing fine but it is not adding the objects in the array.The code is as follows: NSData * imageData = UIImageJPEGRepresentation(img, 1.0); int i=0; do{ if([[tempArray objectAtIndex:i] isEqual:imageData]) { [tempArray removeObjectAtIndex:i]; } else { [tempArray addObject:imageData]; //NSLog(@"ANURAG %@",[tempArray objectAtIndex:0]); } }while(i<[tempArray count]) ; The NSLog statement shows the object added is null however the value of imageData is not null. I have defined the tempArray as a static memeber of the class in which this code is written. Is it because of the size of the data object as it is the data of an image????

    Read the article

  • iPhone reachability checking

    - by Sneakyness
    I've found several examples of code to do what I want (check for reachability), but none of it seems to be exact enough to be of use to me. I can't figure out why this doesn't want to play nice. I have the reachability.h/m in my project, I'm doing #import <SystemConfiguration/SystemConfiguration.h> And I have the framework added. I also have: #import "Reachability.h" at the top of the .m in which I'm trying to use the reachability. Reachability* reachability = [Reachability sharedReachability]; [reachability setHostName:@"http://www.google.com"]; // set your host name here NetworkStatus remoteHostStatus = [reachability remoteHostStatus]; if(remoteHostStatus == NotReachable) {NSLog(@"no");} else if (remoteHostStatus == ReachableViaWiFiNetwork) {NSLog(@"wifi"); } else if (remoteHostStatus == ReachableViaCarrierDataNetwork) {NSLog(@"cell"); } This is giving me all sorts of problems. What am I doing wrong? I'm an alright coder, I just have a hard time when it comes time to figure out what needs to be put where to enable what I want to do, regardless if I want to know what I want to do or not. (So frustrating) Update: This is what's going on. This is in my viewcontroller, which I have the #import <SystemConfiguration/SystemConfiguration.h> and #import "Reachability.h" set up with. This is my least favorite part of programming by far. FWIW, we never ended up implementing this in our code. The two features that required internet access (entering the sweepstakes, and buying the dvd), were not main features. Nothing else required internet access. Instead of adding more code, we just set the background of both internet views to a notice telling the users they must be connected to the internet to use this feature. It was in theme with the rest of the application's interface, and was done well/tastefully. They said nothing about it during the approval process, however we did get a personal phone call to verify that we were giving away items that actually pertained to the movie. According to their usually vague agreement, you aren't allowed to have sweepstakes otherwise. I would also think this adheres more strictly to their "only use things if you absolutely need them" ideaology as well. Here's the iTunes link to the application, EvoScanner.

    Read the article

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