objective-c

Memory management for "id<ProtocolName> variableName" type properties

Hi, I'm having a problem with properties of the following type: id<ProtocolName> variableName; ..... ..... @property (nonatomic, retain) id<ProtocolName> variableName; I can access and use them just fine, but when I try to call [variableName release]; I get compiler warnings: '-release' not found in protocol(s) Do I need to de...

How do I load all my location based content into google maps

I am writing an iPad application that uses the MapKit control. How do I get all my content into Google Maps. i.e. I have a bunch of locations along with photos, video, audio and various other information. So when the iPad user loads my App and zooms into a certain place in the world I want my Annotations to be visible and when they tou...

COCOA Objective-c : How can connect to mysql database?

I am creating application for MAC using cocoa framework, I would like to know how and what are the ways i can connect to MySql database using cocoa framework. ...

How to avoid overriding of methods in subclass in objective c.

Can anyone please guide me on how to avoid overriding of superclass methods in subclass in Objective-C, like the "final" concept in Java. ...

Why can't I use "List" as class name of a subclass of UITableViewController?

Why can't I use "List" as class name of a subclass of UITableViewController? ...

When setting up a timed execution using NSDate, NSTimer, and NSRunLoop, which one do I need to not release before the action in complete?

Here's the part of the code dealing with it: NSDate *fireDate = [NSDate dateWithTimeIntervalSinceNow:1.0+index]; NSTimer *timer = [[NSTimer alloc] initWithFireDate:fireDate interval:0.5 target:self ...

iPhone: [subview release] removes my subview from the display

I have these two pieces of code. The first one works perfectly: UIView *tmp = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 60.0f, 296.0f, 44.0f)]; [self.dynamicView addSubview:tmp]; [tmp release]; The second one is pretty much the same, but the view doesn't show up. CommentBox *commentBox = [[CommentBox alloc] initWithFrame:CGRectM...

How to avoid superclass methods getting overridden by sub class in objective - c

Like in java: A final class cannot be subclassed. This is done for reasons of security and efficiency. Accordingly, many of the Java standard library classes are final, for example java.lang.System and java.lang.String. All methods in a final class are implicitly final. How can I achieve this behavior in objective-c? ...

Objective C - Constants with behaviour

Hi, I'm new to Objective C. I am trying to define Constants which have behavior associated with them. So far I have done - @interface Direction : NSObject { NSString *displayName; } -(id)initWithDisplayName:(NSString *)aName; -(id)left; // returns West when North -(id)right; // return East when North @end @implementation Dire...

set Width & Height alone on Views in iPhone Development

Hey guys, I am working on an iPhone project where i need to change the width and height of a UIImageView dynamically. I have come across CGPointMake to change x & y positions alone, but what should i use for changing width & height alone??. There's something called CGSizeMake but i am not able to make it work. Can someone help...any idea...

Is there a way to write a NSTimer so it just pauses the program for a second?

Trying to change a button pic, wait a second, then change back. Not having much luck trying to get that to work, so is there a way to just pause the program for a second, without having a timer actually executing anything, and without the program going on with the code? ...

How can I use the value of a variable from one class in another in Objective-C?

I am fairly new to Objective-C and have been doing some iPhone programming. Is it possible to look up the value of a variable in a different class? Basically what I am doing is running a function that exists in my application delegate from a view controller, but the application delegate needs to use a variable stored in the view contro...

Do you need to release parameters of methods at the end of them in Objective-C?

If I have a parameter passed to a method, do I need to release the parameter at the end of the method? ...

How to round an float value and convert it into NSInteger value in Iphone sdk?

Hi Guys, I need to round a float value and convert it into NSInteger value. for example: float f = 90.909088; I want the result as 91. Can any one help to get rid of this. Anyone's help will be much appreciated. ...

Face Detection API for Objective-C

Hello, everybody. Does someone here knows a face detection API for Objective-C? I just want to detect one or more faces inside a photo, so it's not necessary face recognition. I want to build something similar to the iPhoto's feature that puts a square on all faces in a photo. It would be nice if the API can be used on iPhone apps to...

Releasing instance if service not enabled?

I would just like to check if I have this right, I am creating an instance of CCLocationManager and then checking if location services are enabled. If it is not enabled I then report an error, release the instance and carry on, does that look/sound right? locationManager = [[CLLocationManager alloc] init]; BOOL supportsService = [locati...

iPhoto publisher plugin

I'm trying to write iPhoto export plugin for my site. I found that there is two ways: export plugin and publisher plugin(like FacebookPublisher or FlickrPublisher). But I can't find any information how to write it. I need album properties, image collection accessors, button and sidebar integration methods or hooks. Other things like HTTP...

How do I get the index of the current Object in an NSEnumerator iteration?

Question: How do I get the index of the current Object in an NSEnumerator iteration? (I don't want to keep track of things using an integer counter or use a for loop due to speed reasons. I did it before I just cannot remember how I did it...) ...

How to display sheet contained by different NIB with separate sheetController

I need to open sheet from separate NIB and wants to use its separate controller awakeFromNib to configure sheet controls.Please let me know the best way to do that.I am using 10.5 API with XCODE 3.1.4 ...

Scrollview of tweetdeck

I am busy with an application and I want to implement a scrollview like the tweetdeck application. You can zoom in en out UITableviews within an UIScrollview. I was wondering how they did that. What I can imagine is that there are two UIScrollviews. This because of the zoom in and out of one item in the UIScrollview. What I don't unde...