objective-c

How do I consume a web service in objective c?

I have a web service developed in coldfusion that I am trying to consume on the iphone. The web service returns JSON which should be fairly simple to read. However, I have been unable to find a good simple example of an iphone app calling a web service and using the data. Are there any good tutorials or examples out there that I am just ...

Using valueForKeyPath on NSDictionary if a key starts the @ symbol?

Hi there, I want to use valueForKeyPath on my NSDictionary, but the problem is that one of the keys is a string that starts with the @ symbol. I have no control over the naming of the key. I'm having problems trying to create the key path as I'm getting a format exception, even when trying to escape the @ symbol: This works fine: [[[...

UIKIT_EXTERN_CLASS and UIKIT_EXTERN, for what these 2 constants are?

When i go to definition of classes in documentation, i always see these 2 things (UIKIT_EXTERN_CLASS and UIKIT_EXTERN) before the @interface, what these constants stand for and why Apple put it before their classes? And one more thing, there is file UIKitDefines.h and it has all these definitions/constants. #ifdef __cplusplus #define U...

How do I create a CGImage with RGB data?

Can anyone show me a clear example of how to use CGImageRef CGImageCreate ( size_t width, size_t height, size_t bitsPerComponent, size_t bitsPerPixel, size_t bytesPerRow, CGColorSpaceRef colorspace, CGBitmapInfo bitmapInfo, CGDataProviderRef provider, const CGFloat decode[], bool shouldInterpolate, CGCo...

How can I decrypt blowfish encrypted string without using OpenSSL in Mac OS 10.5/10.6

My application is currently using SSCrypto.framework to decrypt a string encrypted with Blowfish. SSCrypto utilizes OpenSSL which is a new problem for me. Using the 10.6 base SDK while targeting 10.5 doesn't seem to work. The issue is explained in this Apple Mailing List thread: http://lists.apple.com/archives/Cocoa-dev/2009/Aug/msg01737...

Is it possible to set a tag or ID for an animation on the iPhone?

I have an implict animation as follows: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1]; [UIView setAnimationDelegate:self]; ... [UIView commitAnimations]; When this animation begins and ends, it triggers these delegate functions: - (void)animationWillStart:(NSString *)animationID context:(void *)context;...

Loading tableview from another class in iPhone

I have a RootViewController class and a UserSettingsController class. I have defined the UITableView methods (numberOfRowsInSection, cellForRowAtIndexPath) in the RootViewController class. I want to reload the table view defined in the RootViewController class from the UserSettingsController class. How can I get control of the tableVie...

How do I call NSManaged object's @dynamic method from from another object using a @selector and NSInvocation?

Cocoa newbie here. I am working on an iPhone UITableViewController-based widget that can be used to edit date and text properties in an object set during initiation. Currently, I am attempting to do this with a @selector and NSInvocation as below. Note: the "targetObject" is the object set when the controller is initialized. - (IBAct...

Copy UI element in Objective-C

Hi there, I'm trying to customize the UIImagePickerController for iPhone right now. I could modify the default buttons (take and cancel) as well as add more buttons. But I have trouble when attempting to make the customized button look-and-feel like the default iPhone's ones. At first I think that it'd be possible if I get and then clone...

Comparing Touch Coordinates.

Is it possible to compare touch coordinates made by the users on the UIView to the one store in a plist or txt format? The argument looks like this; if (user touch coordinate == touch coordinate stored in plist or text) then (do something) else (do something) If possible in what format should i write the coordinates in t...

Restricting the rolling of UIPickerView

Hi, I want to restrict the movement of the picker. For Example: I wanna restrict the movement of picker by one row, no matter how hard the user rolls the picker. Does anybody know how it's done.... ...

iPhone Timer Picker

Is it possible to make this go as granular as seconds without having to write a custom picker? ...

which languages to include in iphone app for creating localizable for both western and eastern languages?

i am creating a iphone app which i want to localize. So which languages should i include in my app for creating localizable for both western and eastern languages? i want to know what does the western and eastern languages means? ...

Having problem with view switching from a subview...

Hi Everyone, Maybe this is a silly question but I'm having a problem with switching the view in a subview. Let me explain the code structure: I have these class files: /classes/MySoftwareAppDelegate.h /classes/MySoftwareAppDelegate.m /classes/ViewController.h /classes/ViewController.m /classes/LoginController.h /classes/LoginControlle...

UIViewController subclass init not called when loading from nib

I tried overriding the default initWithNibName designated initializer of a UIViewController subclass like so: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { // Custom initialization } return self; } I have also included it...

Is there a way to view the undo stack?

I'm learning about undo, and I'd like a way to peek into the undo objects (NSInvocations) in the undoManager so I can see what's going on. I couldn't see anything like this in the docs, but maybe someone knows a way. Thanks. ...

How to limit a UIImageView to move in a specific path?

This is an iPhone programming question. How to limit a UIImageView to move in a specific path? The path is a circle, and I want the UIImageView to follow exactly the perimeter of the circle. How can I achieve it? ...

iPhone Memory Management: No Need to Clean Up and Release Retained Objects on App Quit?

Is the following true? When the app is about to quit, it's not necessary to clean up the memory by calling release on all your retained objects, because the iPhone OS will reclaim the memory it allocated for your app when you launched it. This is faster and safer than rely on the apps to correctly clean up after thems...

How do you use groups in XCode?

I started using groups in Xcode the same way I use packages in Java or namespaces in C++, even though groups have no effect on the language. Then I discovered Smart Groups and realised that it's sort of pointless to have my code neatly organised in "folders". Do you use groups? If so, how and why? ...

disordered/ordered context fetching

Hello to everyone, I cannot understanding why values assign to array objects become "disordered" after executing executeFetchRequest. Well, I'm not certain that fetching is the problem here. Here's the code. objects=[NSArray arrayWithObjects:@"a",@"b",@"c",@"d",@"e",nil]; NSManagedObject *DB = nil; for (int i=0;i<[objects count];i+...