objective-c

Can I remove the mask on interface orientation animation?

Hi I am developing an iPad app which starts with a graphical menu. When the user rotates to landscape, the user sees the same menu, but it shows more of detail in the width and less in the height (natch). However, when the rotation animation happens, the default black masking is seen around the edges. Is there any way of switching this...

Strange bug with View interaction

I have to views. One on top of the other. But i cannot click the subviews of the top view until I set the alpha of the bottom view to 0.0. Why would that be? Is there some kind of work around? Code involved -(void)setUpOpponentsCardStartingPosition { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; CGRec...

Best way to set a configuration file in iOS app

Hi. I'm making my first iOS application to be run as an adhoc release on an iPad as part of a university project. I need to have a configurable file somewhere within the source for setting price constants that are to be accessed from multiple subclasses of a superclass. I'm wondering what is the best way to store these values, as there...

Can I use NSAttributedString in Core Text in iOS?

Hi, I'm trying to work out how to take an NSAttributedString and use it in Core Text on the iPad. I watched one of the WWDC videos (110) which has slides (but no source code) and it describes how to create an NSAttributedString, then just put it into a CTFramesetterRef: CTFontRef helveticaBold = CTFontCreateWithName( CFSTR("Helvetica-B...

regarding iTunes & iPhone simulator

I want to know how I can synchronize images, music & videos through iTunes to the iPhone simulator. ...

ASIHTTPRequest: https with SSL

How to implement a https connection with SSL and ASIHTTPRequest? Are there some special steps to do? Can it be that this has nothing to do with ASIHTTPRequest? It has to do only with the server-side I think. Can someone post a link or describe the process of how a https connection can be established? This is what I found out so far: I ...

ASIHTTPRequest: keychainPersistence

ASIHTTPRequest can store the username/password in the Keychain. How does this work? 1) Is the built in authentication dialog (ASIAuthenticationDialog) coming up and stores the username/password only for the first time? When will the dialog be presented? 2) What about the next requests? Is always the same username/password used? 3) Wha...

How to display Data from RSS Feed in Parts in Iphone Application

Hi all. I am displaying RSS feeds in my table view. as there are hundred of feeds so my application takes lots of time to load them and display them i want to load just first 25 feed and display them in Table view and when User Click on More 25 application load next 25 and display them. Any Idea........... :) I am using TouchXML t...

Animating a hand of a clock. (Rotation)

So I have my clock as a UIImageView. Thats perfect the clock doesnt move. I am happy with that. I am so have the hand of my clock as another UIImageView and it is placed on top of the clock ImageView. I want to get my Hand of the clock to rotate 360degrees over 10 seconds, but the tricky part is that I want to make it rotate not on the...

ASIHTTPRequest: check if username/password is correct

How can I check a webservice if the username/password is correct? I don't want to transfer the whole response body. I only want to know if the username/password exists and is correct. Currently I'm sending a request to my webservice like this: self.request = [ASIHTTPRequest requestWithURL:urlObject]; [self.request setUsername:username]...

NSArray and bool values

Can an NSArray hold an array of bool values? The following code runs BOOL b = NO; NSMutableArray *array = [[NSMutableArray alloc] init]; [array addObject:[NSNumber numberWithBool:b]]; NSLog(@"value is %d", [array objectAtIndex:0] ); However, I don't get a value of 0 for NO as expected. Instead, this is what I get value is 3773...

Best practices for using coding convention in companies

Hi (Objective-C and others) guys, I've a question, and I don't know if this is the best place to ask for it. Few days ago, dannywartnaby helped me with a problem I had and gave me an interesting advice, which can be considered as a coding convention, which is to prefix yout class files with your initials. I wonder if you know other bes...

ASIHTTPRequest: when does ASIAuthenticationDialog appear?

When does the authentication dialog appear? If I didn't set the username/password in the request or URL? ...

Where to put "extra" implementation?

Hi there. Occationaly I see snippets of code creating new methods for objects and such that looks like this: @implementation UIImage (Extras) - (void)aMethod:(id)anObject { // some functionality } @end Where do I put this code? Do I put it in the class I'm currently writing code for? If so at what point in the code do I need to p...

Date and time zone problems in Cocoa

I hav a string e.g. 2010-09-24. Now I want this string read as it is in an other timezone as I am. So I create an NSDateFormatter and set it's time zone e.g. to Europe/Berlin. What I get back is an NSDate object adjusted (2010-09-23 18:00:00) to my local time zone (e.g. America/New_York). But I want an NSDate in the time zone Europe/Be...

UISwitch in a UITableView cell

How can I embed a UISwitch on a UITableView cell? Examples can be seen in the settings menu. My current solution: UISwitch *mySwitch = [[[UISwitch alloc] init] autorelease]; cell.accessoryView = mySwitch; ...

NSString manipulation

I have an NSString which I need to 'clean' before feeding it into my json read however I can't find a way of doing so. This is my NSString: "DUMMY({parameters:{code:"60246", language:"en", country:"en"}, result:{"...JSON...});" Basically I need to remove everything except: {"...JSON...} The problem is the codes etc change? ...

Objective-C equivalent to Java's anonymous classes in class methods

I want to set the delegate of an object inside a class method in Objective-C. Pseudo-code: + (ClassWithDelegate*) myStaticMethod { if (myObject == nil) { myObject = [[ClassWithDelegate alloc] init]; // myObject.delegate = ? } return myObject; } In Java I would simply create an anonymous class that implement...

Cmake compile with Frameworks on Mac OSX and treat .cpp files like .m/.mm

...

How to properly shut down/restart NSThread after applicationDidEnterBackground/applicationWillEnterForeground

For performance reasons, I instantiate a dedicated NSThread to process incoming messages that are streamed from a network server. I use an NSOperation for the purpose of instantiating the connection and receiving incoming data through the NSURLConnection delegates, but as soon as new data comes in and gets parsed, I offload the processi...