I am playing around with a strategy game where squads move around a map. Each turn a certain amount of movement is allocated to a squad and if the squad has a destination the points are applied each turn until the destination is reached. Actual distance is used so if a squad moves one position in the x or y direction it uses one point, b...
Hi,
What's the correct way to resign the current firstResponder?
I've seen the following:
Looping through fields and calling resignFirstResponder on each.
[[self textFieldForRow:0] resignFirstResponder];
[[self textFieldForRow:1] resignFirstResponder];
[[self textFieldForRow:2] resignFirstResponder];
[[self textFieldForRow:3] resign...
Hello,
I created a subclass (called MyPicture) of the UIImageView with this methodes:
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.userInteractionEnabled = YES;
}
return self;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"-- I AM TOUCHED --");
}...
Hi,
I have a view that was created with all of the default UITableView stuff, but now I need to add a header area above where the UITableView is (so the UITableView will scroll normally, but the top 100px of the screen or so will have static header content). I don't see where I can resize the UITableView in IB, and am not sure how to do...
I am trying to work out (or find) a button that looks half decent for use in my app. In the image below I have two buttons at the bottom, the default button (interfaceBuilder) and one using two png images from the Apple UICatalog.
I am a little shocked that apple did not include something a little more stylish in IB. I assume that my on...
If I'm writing drawing code in Core Graphics on Mac OS X or iPhone OS, I can set the active fill color to red by calling:
CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0); // RGB(1,0,0)
If I want 50% gray, I could call:
CGContextSetRGBFillColor(context, 0.5, 0.5, 0.5, 1.0); // RGB(0.5,0.5,0.5)
But for shades of gray it's tempt...
I am working on a game where I want to create shadows under a series of sprites on a grid. The shadows are larger than the sprites themselves and the sprites are animated (i.e. move and rotate).
I cannot simply render them into the sprite png, or the shadows will overlap adjacent sprites.
I also cannot simply put shadows on a lower la...
I am saving the first and last name from ABpeoplepickerNavcontroller, I would like to merge the first and last name prior to saving into an array so that when i retrieve it, they would be together. The first code is the object being created:
// setting the first name
firstName.text = (NSString *)ABRecordCopyValue(person, kABPersonFirstN...
Sorry, I would just test this myself, but I'm currently without my mac. Does a web request made inside of a UIWebView send the same user-agent info that a web request made from mobile Safari would?
...
I'm a newbie and need some help with an iPhone App running on the Simulator. The app works fine running with Build & Run or Build & Run - breakpoints off, but blows when running with Build & Debug - Breakpoints on. Any help or thoughts would be greatly appreciated. Lon
Specifics: No breakpoints set, never gets to any visible simulator ...
I am saving arrays of doubles in an NSData* object that is persisted as a binary property in a Core Data (SQLite) data model. I am doing this to store sampled data for graphing in an iPhone app. Sometimes when there are more than 300 doubles in the binary object not all the doubles are getting saved to disk. When I quit and relaunch my a...
I have a TestData.plist stored in the resource folder and when the content is displayed in the textview i want it to be editable in a sense that user can edit and save the text on textview to the same TestData.plist file. what is the best way to do it?I am a total noob in iphone dev. Need help please..
...
When I select the "Português (Portugal)" from the languages, the iPhone automatically uses the pt_PT localization, right?
But, if someone uses "Português" as it's laguage and defines the Region to "Portugal", it won't go for the pt_PT strings, going for pt file instead.
My question is: is there another "two-letter code" associated with...
I have HTML files that I want to load locally. I have included the files in the resources folder in XCode. I am not sure what the syntax is to load them.
This is the code I use to connect to say google.
NSString *urlAddress=@"http\\someurl";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest reque...
When I run my Iphone app on my Ipod touch, it runs fine most of the time. But every so often, it will hang for a short while -- anywhere from 5 to 15 seconds. After the hang, it resumes running normally.
The strange thing is that to all appearances, the app's demands on the system should be fairly steady. It is doing a lot of draggin...
Hi,
I have released and updated a few apps now, but this is still not very clear.
The app name as it appears on the app store is set from iTunes connect. Where do you set the name of the app as it appears on the phone once it is installed?
I have tried and succeeded in setting it in 'Product Name', but when Product Name has a space in...
Hi there.
I want my app (LaunchDaemon) to keep running even if user locks the iPhone. My LaunchDaemon simply check a file and if some condition is true, it displays an Alert to the User. Its working great when iPhone is on Home Screen, but it is not working when user Locks the Screen.
I want something Similar to Alarm app of iPhone whi...
I tried submitting my application but was told that the file cannot contain any spaces. To fix this I simply renamed my .app file without the spaces, compressed it, and resubmitted. My question is was this sufficient, or do I need to rebuild my application without the spaces in the binary name?
...
So assume I have a class that has an init method that does something like... grabs some data off the net in xml format and parses it to initialize some of its properties. My concern is how should I handle the case where the network is down or the xml data my object receives is bad?
Normally in C i would use return values to indicate an...
here is my plist and code
> <plist version="1.0">
> <dict>
> <key>Title</key>
> <string>News</string>
> <key>icon</key>
> <integer>0</integer>
> </dict>
> </plist>
int i = [dictionary objectForKey:@"icon"];
NSLog(@"%d",i);
log result is 81841904
why it not 0 ?
...