objective-c

Objective-C property reference count

Could someone please help me understand reference counting in Objective C properties. Suppose I have class @interface TA : NSObject { TB* tb; } - (id) init; - (void) dealloc; @property (nonatomic,retain) TB* tb; @end @implementation @synthesize tb; - (id) init {...} - (void) dealloc {...} @end My understanding is that assignment...

Set the title of an UIPopOver View Programmatically

How do you set the title of an UIPopOver View programmatically? I found some sample code but wasn't able to set the title. myView *theView = [[myView alloc] initWithNibName:@"myView" bundle:nil]; UIPopoverController* aPopover = [[UIPopoverController alloc] initWithContentViewController:theView];...

how to add carousel effect in iphone application

Hello, I want to add some carousel effect in my iphone application. i want to show some items in carousel effect. so can any one suggest how i do this ? Thanks ...

How can I track a MPMoviePlayerController without stopping and starting

I would like to skip through a movie using a slider (which I have successfully implemented) and believe the only option is to use the initialPlaybackTime property. I've found that to use this I need to first stop and start the video. This is a problem as I have events firing during the movieDidFinish event which I dont want to fire when...

calling methods in cpp like @selector(someMethod:) in Objective-C

In Objective-C you can pass a method A as a parameter of other method B. and call method A from inside method B very easily like this: -(void) setTarget:(id)object action:(SEL)selectorA { if[object respondsToSelector:selectorA]{ [object performSelector:selectorA withObject:nil afterDelay:0.0]; } } Is there any functiona...

sort elements of a table view in sections

in my app I have a table view where I download a list of hotels parsed by an XML(for every hotel i put in xml an attribute STARS); I need to view hotels by stars (from 5 stars to three stars), dividing it into three sections. So I have a section "5 stars" where there are 5-star hotel, a section "4 stars" where there are the 4-star hotel ...

Iphone programming

how to find whether a particular application already exists in iphone through code ...

how to know if current architecture is i386 or x86_64 in macs? (Xcode)

Hi, I am handling a camera that needs different parameters in different architecture, Is there a flag that I can check to see if I am in 32bits or 64bits in my mac? I was trying this but does not seem to work, I always get 32Bits!! : #if defined(PER_ARCH_CFLAGS_x86_64) NSLog(@"64bit!!"); #else NSLog(@"32Bits!!"); #endif ...

UIImage masking gives black background on the iPhone (and not in simulator)

Hi there, I've got mask images w/o alpha channel, pure black and white with a black polygone on the center sourrounded by white. I've got png's image that I'd like to mask. the png have got an alpha channel. using the method here below : ok on simulator, but background is black on device ... any idea to fix that ? - (UIImage*) maskIm...

Generate unique temporary file paths

Hi, I want to generate unique file paths in Objective-C. I looked at NSTemporaryDirectory() but the closest I could get was to this and this. But in the second one they create such a file. I do not want to create it, I just want an NSString for a unique writable path... I don't need paths to folders, just files. How is this possible? ...

Example code for sending SMS from iPhone

Could someone please direct me to some sample code that demonstrates how to send SMS from the iPhone. ...

Title about @Protocol and categories

I want to know about categories and Protocol with example for objective-c ...

how should you cancel an NSInvocationOperation so that your code stops?

I have a background thread that goes off to a server and gets XML which then renders it to a graph. I have an NSTimer which fires off a request every 5 seconds, what is typically the best way to stop the execution of a thread altogether (if at all possible), I know you can subclass NSInvocationOperation and implement the cancel method, ...

UIPickerView select a date and corresponding result shown in UITableView.

Hi! I am new to this field, presently i am on an application in which i'm parsing the data from xml file in my xml file there is a date (yyyy-mm-dd format), time (hh:mm format). i took some variable in application to store them like NSDate for date from xml and NSString for time purpose. i need that if i select some date from UIPickerVie...

Iphone programming

Possible Duplicate: How to programmatically send SMS on the iPhone? how to develop/code an application which could send sms from iphone with text in it. ...

How i use Php in iphone

Hi all, I am new in iphone,in my app required data from the server. 1)mysql database uploaded on the server 2)With the help of php code i fetch the data from the server problem is that how i integrate php in my iphone please solve my problem, give any reference. Thanks, ...

Does core data handle creating the actual db?

I am learning to use Core Data. I have created a data model etc and have been inserting items using NSManagedObjectContext and NSManagedObject. I have noticed something though - I didn't have to create any db. So why question is - when I create the data model - is that actually creating the db i.e. is that all there is to it? It seem...

iPhone application crash (iOS4 Only)

Hi there, My iPhone application occasionally crashs the first time it is run after being installed. After this every time i try and run the app it remains on the splash screen or even a black screen until eventually it dies. I have to restart the device to get the application to work. After this it works fine every time. The only change...

NSString unexpectedly becomes __NSCFDictionary

Hi guys, I have this very strange problem, I'm new to objective-c and it probably comes from depths which I don't comprehend yet. So, in my header file I declare the variable NSString *curTitle; then in .m file I synthesize it: curTitle = [[NSString alloc] init]; after that in other method I assign it: curTitle = string; // strin...

UIImagePicker not showing Original Image from Photos Library in OS 3.1.2

Holy Crap! Really... I'm frustrated with this problem that get me stuck with my apps for a week now. Here is the code - (IBAction)loadTheImage { UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; // picker.sourc...