objective-c

Objective-C and Protocols

Do protocols come with any overhead? (ie. obvious benefits aside, do they slow things down?) ...

UI Acclerometer refrence

Hi all, I Want to develop an application based on UIAccelerometer..The application is as follows.. As you move your iPhone in space, Air Paint creates a path of this movement mimicking a form of light graffiti. Actually some one suggested me this application.....Can any body has an idea of how to go about it? THX ...

OpenGL ES functions not accepting values originating outside of it's view

I've been unable to figure this out on my own. I currently have an Open GLES setup where a view controller both updates a game world (with a dt), fetches the data I need to render, passes it off to an EAGLView through two structures (built of Apple's ES1Renderer), and draws the scene. Whenever a value originates outside of the Open GL vi...

CLLocationManager class

hi all, can CLLocationManager class be used to compute the distsnce travelled by the person? ...

Disable animation when moving CALayers

The following code animates the movement, even though I didn't use beginAnimations:context. How do I get it to move without animating? This is a new iphone view project, and these are the only updates to it. // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super v...

UIImage imageNamed not autoreleasing correctly

For some reason, the retain/release behavior in the following code has me completely baffled. selectedImage = [UIImage imageNamed:@"icon_72.png"]; [selectedImage release]; This should break but does not. Why? I thought imageNamed autoreleased itself which means the release here is redundant and should break when the autorelease occurs...

release array created from parameter

How can I release an array created from a parameter? I have function like -(NSMutableArray*)composePhrase:(NSString*) phraseLiteral{ ... NSArray* wordLiterals=[phraseLiteral componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"[]"]]; ... [wordLiterals release]; } and I always got probl...

How do I print the application's path?

How do I print the application's path? ...

Memory efficient collection class

I'm building an array of dictionaries (called keys) in my iphone application to hold the section names and row counts for a tableview. the code looks like this: [self.results removeAllObjects]; [self.keys removeAllObjects]; NSUInteger i,j = 0; NSString *key = [NSString string]; NSString *prevKey = [NSString string]; if ([self.allResu...

How to tell a UITableView to preload all Rows?

Is there a way to tell a UITableView to preload all rows? The tableView is supposed to show several comments (up to 80 comments). So my CommentCell uses a Setter to adapt the cell to a specific comment. -(void)setComment:(Comment *)newComment { if (newComment != comment) { [comment release]; comment = [newComment retain]...

IBOutlets are always nil

Hi, I added an object to my .nib and I connected IBOutlets to it. But the object doesn't initiate the .nib. Another object does that. When I initiate the object added to my .nib (from somewhere in my code), then all IBOutlets are nil, even if the nib has been loaded. What am I doing wrong here. ...

Problem in type casting in NSDate to NSString?

Hi, I developing an application, in which i found a ridiculous problem in type casting, I am not able to type cast NSDate to NSString. NSDate *selected =[datePicker date]; NSString *stringTypeCast = [[NSString alloc] initWithData:selected encoding:NSUTF8StringEncoding]; From ,above snippet datePi...

from JS to iphone dev - what's the best language to start with?

I am a total beginner and would like to eventually learn to develop for the iphone. I have just done a beginner's CS course where the language we learned was JavaScript. We studied basic concepts like: variables, arrays, loops (for,while,if,if..else..), properties and functions. I'm wondering if I am starting in the right/wrong place b...

Why is the class wrong for NSFetchRequest?

Hello, I am working with an undocumented API (Osirix) and I have a sister-question to the one I posted here. I am having trouble loading objects from a managed object context. With loading from API, using their instance of _context and _model 2010-05-28 14:05:13.588 OsiriX[44012:a0f] Entity: Study 2010-05-28 14:05:13.589 OsiriX[44012...

iPhone Utility Application Convert to View Based Application

Hello everyone, I have a an utility application that was built for the iPhone SDK on Xcode. However, I need to incorporate the application code into my View Based Application. What I am trying to do is create a button on my View Based Application, that will initiate the code that was meant in the utility application. Somehow this all is...

EXC_BAD_ACCESS when calling avcodec_encode_video

I have an Objective-C class (although I don't believe this is anything Obj-C specific) that I am using to write a video out to disk from a series of CGImages. (The code I am using at the top to get the pixel data comes right from Apple: http://developer.apple.com/mac/library/qa/qa2007/qa1509.html). I successfully create the codec and con...

integrating camera and email

I want to develop an application that will automatically send an email as soon as an image is captured by the camera. can anybody suggest some ideas regarding this??? ...

Setting corelocation results to NSNumber object parameters

This is a weird one, y'all. - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { CLLocationCoordinate2D coordinate = newLocation.coordinate; self.mark.longitude = [NSNumber numberWithDouble:coordinate.longitude]; self.mark.latitude = [NSN...

Scroll immediately to row in table before view shows

A view with a table gets pushed onto the screen and I want it to scroll to a certain row in the table before the screen actually displays. I use this code within the final viewcontroller. NSIndexPath *scrollToPath = [NSIndexPath indexPathForRow:5 inSection:0]; [theTable scrollToRowAtIndexPath:scrollToPath atScrollPosition:UITableViewSc...

Changing a view after modalViewController is dismissed (Cocoa Touch)

I have a viewController that presents a modalViewController when a UINavigationBarItem is touched. After the user is done with the modal view, the modalViewController is dismissed. At this point I want to change/remove the NavigationBarItem -- how would I accomplish this? I was thinking of using viewWillAppear: but I only want the chan...