I'm trying to send an authentication string via cookie in a NSMutableURLRequest. I'm trying to create the NSHTTPCookie through
+(id)cookieWithProperties:(NSDictionary *)properties
But nowhere have I been able to find how to specify the properties other than the simple key-value pair I have for authentication. When I only use my key-v...
I would like to conditionally include code for an iPhone app depending on which version of the SDK I'm compiling against. On Mac OS X, there is the MAC_OS_X_VERSION_MIN_REQUIRED preprocessor macro which gets set to the value of the MACOSX_DEPLOYMENT_TARGET build setting by the compiler. Is there an equivalent on the iPhone?
Update:
I...
I want to save the current tab the user is in when he/she quits the application so I can load the application with that tab highlighted when the user re-enters the app.
I presume I use the following method within my app delegate to save the current tab
- (void)applicationWillTerminate:(UIApplication *)application
but how do I gain acc...
Hi!
I would like to keep track of the date with timestamp. What objective-C/cocoa class could I use to get the timestamp local to the machine's time settings?
if for example I'm in USA, timestamp should be in terms of the area where I'm at. If I'm in Europe, should be in Europe time.
Small example would be so helpful!
...
I have a UITableView that when scrolled to far bounces bag. This also means the user can drag the table so that only half of it is visible and the other half of the main view is white. This causes some weird behavior in my app. I create an array in the AppDelegate. In RootViewController's viewDidLoad, I get a reference to the AppDele...
Following is Objective-C code where I'm trying to do a compare between two NSString values, however it throws a runtime error. Here's the code:
NSDictionary *innerContent=[JSONResponseDict valueForKey:@"JSONRESPONSE"];
NSString *authFlag = [innerContent valueForKey:@"authenticationFlag"];
NSLog(@"authFlag = %@",authFlag);
UIAlertView ...
Are there any tutorials describing how to create a library or is it framework for the iPhone? I have a number of methods that are shared between applications. These will be better maintained as a library.
...
I am developing an iPhone application using Objective-C. I want to access a data member which is of type NSMutableArray of the RootViewController class in another class. I tried making the array static. But I would like to have a non static array. How do I achieve this?
...
I'm writing an iPhone application that needs to get some data from a web server. I'm using NSURLConnection to do the HTTP request, which works well, but I'm having trouble unit testing my code in the case where the response has an HTTP error code (like 404 or 500).
I'm using GTM for unit testing and OCMock for mocking.
When the server ...
I have a class called GameScene, with is a subclass of a cocos2d Scene.
In there I have two layers. GameLayer and ControlsLayer. You can probably tell already that I want the ControlsLayer to move stuff around in the GameLayer. To be precise, I'm trying to control a cPBody in the GameLayer from the ControlsLayer.
At the moment, I'm t...
Is it possible to determine the speed at which someone is shaking their iPhone? This would be the time they start moving to the ending point where they are now going back to the origin. Basically it is one swipe that I'd like to measure the speed of. This discussion comments on initial speed: http://discussions.apple.com/message.jspa?...
Hi, I have written an cocoa application to take a picture on the iPhone. I need to transfer the images taken to somewhere besides the iPhone namely another server. Does anyone know how I can accomplish this?
Thanks,
Joe
...
I replaced one tab bar button in interface builder. It was "Recent" button, I changed it to "Contacts" button. Now the tab bar button not showing up, but I could click on that position, and action does work. The neighbor unchanged tab bars have no problem though.
I could not find any place to set the visibility of Tab Bar button.
Than...
What is an easy way to time a Cocoa application? (Alternatively, any good way to measure performance would suffice).
(I have two different frameworks and would like to compare their performances over some fixed input data)
...
I'm having some trouble with displaying results from a datasource. This code will show a different (and correct) result in the console, but results in all kinds of random crap in the simulator.
("results" is an NSMutableArray property for the class.)
-(void) handleSearchForKeywords: (NSString *) keywords {
[results removeAllObjects...
I am trying to add a variable amount of MenuItem objects to a Menu object on runtime. When my game starts I don't really know if my menu is having 2 or for example 5 items.
for (MyItem* item in myItemCollection)
{
MenuItemImage* menuItem = [MenuItemImage itemFromNormalImage:@"MenuItem.png" selectedImage:@"MenuItemSelected.png" targ...
I'm running into a case where I have in-application HTML documentation that uses a dark background, but the default scroll indicator for UIWebView is getting lost in that background. The following is an example of this:
With UIScrollView, which UIWebView resembles in its behavior, you can set the indicatorStyle property to UIScrollVi...
Hi, is there a way to display a hyperlink in an iPhone native app. Is this done with a label or another UI object?
Thanks!
Joe
...
Hi, I'm trying to format large currency numbers like this:
NSNumber *testVal = [NSDecimalNumber decimalNumberWithString: @"999999999999999993.00"];
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[formatter setMaximumIntegerDigits:19];
[formatter setMaximumFract...
I'm trying to convert CLLocation latitude / longitude to a string. I can successfully do this with the follow code:
// extract latitude from CLLocation object and cast to string
NSString *latitude = [[NSString alloc] initWithFormat:@"%g°", location.coordinate.latitude];
this gives me a value like: 34.10111º. I would like this number...