I am interested in writing games for the iPhone and the Web. Ideally, there would be one language that I could write my games in and it would work on both platforms. I know this is not the case, so what is the best way to leverage code between iPhone apps (Objective-C/C++) and Flash SWFs (ActionScript)?
...
Is there an equivalent of selectors for classes? How can I create a instance of a class from a string?
...
I'm originally a Java programmer who now works with Objective-C. I'd like to create an abstract class but that doesn't appear to be possible in Objective-C. Is this possible?
If not, how close to an abstract class can I get in Objective-C?
...
Assume a class Vehicle has a method called "StartEngine", and in my subclass called "Airplane" I want to override "StartEngine". If I use C#, I should use the "override" keyword in Airplane's StartEngine method declaration/definition.
The reason I am asking, is that if instead of "StartEngine" I type "startengine", C# will complain, b...
I'd like an instance variable object to adopt a protocol.
@interface GameScene : Scene <AVAudioPlayerDelegate> {
@private
Layer *content <CocosNodeOpacity>;
}
For example I'd like my Layer object to adopt the <CocosNodeOpacity> so that I can get the methods
-(GLubyte) opacity; //and
-(void) setOpacity: (GLubyte) opacity;
fo...
I'd like to pass dict to the method processit. But once I access the dictionary, I get EXC__BAD_INSTRUCTION.
NSNotificationCenter *ncObserver = [NSNotificationCenter defaultCenter];
[ncObserver addObserver:self selector:@selector(processit:) name:@"atest"
object:nil];
NSDictionary *dict = [[NSDictionary alloc]
...
Appears the 3.0 NDA has been lifted, so this should be safe to ask. If this is violating an NDA, please let me know so I can remove the post, post-haste.
I have a very trivial implementation for KVO on an NSOperationQueue. My problem is that when compiling against 2.2.1 SDK, I get different results for the NSOperationQueue in question f...
Hello guys,
I have an optional binary attribute: image , containing an image for my entities.
In the interface, I have NSImageView (Image Well), and a "Remove Image" button. When the image removing button is clicked, I do:
- (IBAction)saveAction:(id)sender {
NSError *error = nil;
if (![[self managedObjectContext] save:&error]) {
...
I've seen countless infos on how to play a sound file, but how can I generate a specific audio tone (or several) at given Hertz in cocoa touch?
...
I want to use my dictionary keys for output in a grouped table. This has to be localized with all my other content. Can I use an NSLocalizedString as the key?
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
first_array, NSLocalizedString(@"First Array", @"The First Array"),
second_array, NSLocalizedString(@"Seco...
How does one convert an unsigned long number to a float in Objective-C?
...
Playing with URLs, more specifically building them incrementally from other, discovered URLs. In doing so, I'd like to stay using NSURL objects instead of manipulating NSStrings, just to gain the added sanity checks and url-specific methods from the URL class.
Unfortunately, it seems that there is no way to get the following to join to...
Given an NSStepper with a minimum/value/maximum already set, if I set the minimum to a valued between value and maximum, will the NSStepper's value change?
I know I could just try it, but that would only tell me for my current OS, and I can't find any documentation to indicate one way or the other.
...
You can probably see where I am going with this - but is there any easy way to generate a CGAffineTransform from two lines - each represented by a pair of CGPoints:
A[(a1x,a1y), (a2x,a2y)],
B[(b1x,b1y), (b2x,b2y)]
The resultant CGAffineTransform when applied to line A would of course produce line B. It potentially could involve a tran...
Hello,
I have a quite simple question but the answer is not so easy.
I want to hide a UITabBar when my orientation change.
I looked 2 ways :
Frame way
myAppDelegate.tabBarController.tabBar.frame = CGRectMake(<<bottomOfScreen>>);
Works fine but I have a blank area, so tried to play with tabBarController.view.frame et myViewControlle...
Hey guys,
I have a pretty large list of 'items' (up to 250 entries) which is constantly changing. The list is being displayed in a UITableView.
I have a polling thread that will download some new entries and insert them into a SQLite DB.
When new entries have arrived, I call to my table view data source object to update its data set, ...
Hello,
I need to customize the page where on any event the customizable "Button menu pane" has been visible from the bottom, just like one of the application "Twitterrific" (please see the screenshot). I've tried to implement through with modalViewController properties but it populate my customizable view on the whole screen and my par...
In my current project inside the file ViewController.m, running the method:
[[connection writer] writeData: data];
returns the warning:
warning: multiple methods named 'writeData:' found
I am attempting to call the method:
- (void) writeData: (NSData*)data
in TCPWriter.m. Unfortunately there are two other writeData methods
- (...
I have made a multiplayer game using the GameKit Framework where 2 iPhones/iPods can connect to each other via bluetooth and play.
I am thinking of a way to choose which device will be able to play first. So the logical solution is to pick the host of the connection. Is there even a server and a client in the GKSession? Are they all pee...
Are there any high level explanations on how to go about designing a game for the iPhone?
How about open source examples for something like pacman, etc?
...