Which framework do you suggest for building a 2D platform game for the iPhone? I only need to move assets around the screen and detect collisions etc.
I would think OpenGL. But maybe Quartz 2D is enough? Or is there something else I should be aware of? What are advantages and disadvantages of each?
I guess there is a longer learning cur...
I have a UISearchBar that has a cancel button (it's displayed using -(void)setShowsCancelButton:animated). I've changed the tintColor of the search bar like this in an attempt to get a grayish searchbar:
UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 40)];
searchBar.tintColor = [UIColor colorWithWhite:...
Hi,
In my app, I have two view controllers. The MainViewController switches to the AlbumViewController when a button is pressed. The AlbumVC is supposed to allow the user to select a picture from the PhotoLibrary and/or CameraRoll. So, I try to fire up the UIImagePickerController.
However, when the app runs, I don't see the UIImage...
Hi, I'm currently trying to add a table view to my view hierarchy and am experiencing strange behaviour. The TableView seems to animate from a CGRectZero to its frame, visually seeming to spill onto the page. I am initializing with a frame of {{0,0},{320,367}}, which I have confirmed by Logging out to the console.
This could be a nice e...
I have some apps in mind to control things in my Mac from the iPhone. Probably the simplest thing to do would be to make the iPhone simulate a keyboard and then handle key events on the mac.
What do you think it's the best way to communicate iphone with the mac? Can I use GameKit for that? HTTP?
...
My iphone app writes key-value pairs to a dictionary in a plist file. I'm basically saving the user's score when they play the game. This is all fine and dandy, but each time I run the app and get new scores, the new values get saved over the old values. How do I add information to the plist each time the user accesses the app instea...
For a game I'm developing, I call an expensive method from one of the touch processing routines. In order to make it faster, I decided to use performSelectorInBackgroundThread, so instead of:
[gameModel processPendingNotifications];
I switched to:
[gameModel performSelectorInBackground:@selector(processPendingNotifications) withObje...
I have an application that rotates between landscape and portrait mode, which works great. However, it gets really jumpy and wants to rotate at 45deg at the slightest movement of the device. Is there a way to control the sensitivity of rotation, or prevent it from rotating until it hits certain targets (90, 180, 0) while ignoring the in-...
I've been working on an iPhone application, and since I started building on SDK 3.0 I receive this error whenever the application attempts to communicate with my webserver. Everything seems to be running fine, but I can't find anything that explains the root cause of the message. Any help would be appreciated.
...
Why did Apple decide to use Objective-C for the iPhone SDK and not C++?
It seems strange to me that they would not have chosen a language more popular than Objective-C. Is it because wanted to have something unique in their application which is not otherwise in general use?
I'm just curious about this.
...
I sorta understand better how what the MGTwitterEngine returns....I thought. But i'm still doing something wrong to get it into my table view. This is what I have in my cellforrowatindexpath method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self.ta...
I'm adding my first UITableView and it draws in an unexpected manner. There's a gap (same size as topBar?) between the top of the UITableView and the topBar (referring to the line with the battery indicator).
#import "SettingsController.h"
UIView *settingsView;
UINavigationController *navigationController;
SettingsController *root...
I have the error -[NSCFString stringValue]: unrecognized selector sent to instance 0x1578c when executing this code
I don't understand what I'm doing wrong
name is a NSString
self.searchValues= [[NSMutableArray alloc] init];
name=@"Bob";
if(self.name!=nil)
[searchValues addObject: [NSMutableDictionary dictionaryWithObjectsAndKeys:@"N...
Since there is no counterpart to NSValue in Core Foundation, how are we supposed to store C structs in a CFMutableDictionary?
...
If not, and it needs to be included in a separate file (e.g. MyEnums.h) do I need to #import MyEnums.h every time a .m or .h file wants to refer to the type or one of the values?
Here's sample code of MyClass.h:
#import <Foundation/Foundation.h>
// #1 placeholder
@interface MyClass : NSObject {
}
// #2 placeholder
- (void)sampleM...
I'm trying to measure the visual size of a NSString that takes into account the number of lines I can render. However, sizeWithFont doesn't take into account numberOfLines property? So my layout algorithm positions everything lower than they actually need to be.
_price = [[UILabel alloc] init];
_price.text = myPriceValue;
_price.lineBre...
How can I upload/download data from a server in Cocoa Touch. Here's what I have so far...
-(void)uploadSchedule:(id)sender
{
NSData *content = [NSData dataWithContentsOfFile:self.dataFilePath];
NSString *stuff = [[NSString alloc] initWithData:content encoding:NSASCIIStringEncoding];
NSURL *url = [NSURL URLWithString:@"http://thetis....
I'm very new at Objective C and developing for the iPhone so I apologize if this is an easy answer I've tried searching Google for going on 3 days now and bought iPhone Development for Dummies and no luck on something like this.
Essentially what I would like to do is play a sound when a button is pressed and then I would like to add 1 t...
i have to save some photos in photo library using UIImagePickerController and save that name in my database. at the same way i need to view that saved photos. i dont want 2 see all photos in photo library . which is the better way? please post some samples.
...
Hi everyone
I have a small run speed problem. On load, I generate a CGMutablePath containing at least 1000 points. I want to scroll this path on the screen, so I use this kind of code :
-(void) drawRect:(CGRect)rect {
/*
Here, I have a timer calling drawRect 60 times per second.
There's also code for the scale and currentT...