iPhone/C++/Love/Hate

Sooo I've spent the last several weeks learning to program on the iPhone! It's been an interesting experience, mostly in the differences between my first love (c++) and my mistress (obj-c.) I haven't submitted any of my apps yet, but I'm getting close and...

Question one: I'm wondering, do any of you have much experience on the app store?

My first useful project has been porting my chat application to the iPhone- and it's pretty much fantastic! I now have a single application that chats between windows, OSX, linux, and now the iPhone!!! Of course it's useless because I haven't actually had a need for it yet. heh heh. *well except scaring the heck out of family members by having my mac 'say' stuff sent from my iPod =D

Question Two: I'm going to make a game for the iPhone, and I need some good marketing strategies, do any of you have experience marketing applications? I could really use some tips!


Observations in learning obj-c:

1. I learned that it is essential to plan everything! (I've never planned a single one of my applications before, and well you can see how well that worked out with my ultiscroll project!

2. Memory management is DIFFICULT! At least I have a respect for it now!

3. I wish there was an interface builder for windows... not mfc.

4. C++ seems fathoms faster than obj-c (anyone agree?)

5. Last one, I found that learning a new language is exciting!! It's been years since I started a language fresh, and I have loved it!


I'm considering learning java as well, which would pump up my languages to 3! The largest contributor to this desire is the added ability to create applications for Droid.

Question Three, Four, and Five: Along with this desire I wish to forgo any scripting aspect of the language, is this feasible? Desirable? Do you think I should even learn java?


sub question: do any of you, by chance, desire to get into the app store, but don't want to pay the 99 and get a mac? Send me an email! ultifinitus@gmail.com
Observations in learning obj-c:


Do you need to purchase a MacOS computer before you can start developing using their SDK ?


sub question: do any of you, by chance, desire to get into the app store, but don't want to pay the 99 and get a mac? Send me an email! ultifinitus@gmail.com


You mean a Mac cost only 99? US$0.99 cents ? It cost over a few thousands (S$) in my country just to get a Mac computer!
Yes (technically) you do need a Mac to use their SDK, however you can patch together a hackintosh, and there are other methods of using their Chain. However none of those solutions are reliable, and if you want to make money, you really should buy a mac.

I apologize for the misleading subpost, the $99 is the developers fee to sell apps, my mac broke the bank. ($1200)

Before doing anything I would look at the language itself, it's unfamiliar to me, with things like this ->

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
NSString *swapRandomChars (NSString *input){
	if ([input length] > 1){
		NSMutableString *tempStr;
		NSString *returnString;
		tempStr = [[NSMutableString alloc] initWithString:input];
		int first = arc4random() % [input length];
		int second = first;
			while(first == second){
				second = arc4random() % [input length];
			}
			char tempChar = [tempStr characterAtIndex:first];
		
		[tempStr replaceCharactersInRange:NSMakeRange(first, 1) withString:[NSString stringWithFormat: @"%c",[tempStr characterAtIndex: second]]];
		[tempStr replaceCharactersInRange:NSMakeRange(second, 1) withString:[NSString stringWithFormat: @"%c",tempChar]];
		returnString = [[NSString alloc] initWithString:tempStr];
		[tempStr release];
		return returnString;
	}
	else {
		return input;
	}

}
I apologize for the misleading subpost, the $99 is the developers fee to sell apps, my mac broke the bank. ($1200)


That is what I meant by barrier to entry is high for hobbyist developers. US$99 developer fees + Mac fees add up to be sizeable! Is developer fees annual renewable ?

Objective-C is just regular C with add-ons, like C++.

The [] operator, as shown above, is used to call methods in Objective-C classes, for example:

[pMyObject MyFunction: Parameter1 WithSecondArgument: Parameter2];

Which looks a bit weird, but let me give an example using an std::list, where the erase (iterator first, iterator last) method's name is changed to EraseFrom:

[pMyList EraseFrom: FirstIterator To: SecondIterator];

I prefer this method of calling, well, methods, because you're allowed to give labels to parameters as you type them in, making it much easier to understand the arguments of a function from a glance.



C++ seems fathoms faster than obj-c (anyone agree?)

It is, Objective-C is meant to be runtime-dynamic while C++ is compile-time dynamic. But if you get to use the functionality that's added as a result of this, writing a framework tends to be less of a headache.
Last edited on
I actually like operations of calling methods as well, but since i've never worked in pure C, it was weird starting.

it's been fun =D
Topic archived. No new replies allowed.