Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
NoDamage
Dec 2, 2000
Starting a cocos2d project, does anyone have a recommendation on using Box2d vs Chipmunk for physics?

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
Just use whichever one you prefer.

My understanding is that Box2D is more advanced, but also more complicated. The guy who writes Chipmunk claims that, using the latest version of each lib, Chipmunk is a good deal faster (the version of Chipmunk that ships with Cocos2D is at least one major version behind).

The Chipmunk guy also sells an Objective-C wrapper for Chipmunk, as well as a version that's been optimized for the Neon SIMD unit in ARMv7 processors.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Hopefully everyone's already on the Big Nerd Ranch blog, but if not, they just posted about -isEqual: versus -isEqualToString:. (Spoiler: the author considers the choice "purely stylistic".)

xgalaxy
Jan 27, 2004
i write code

pokeyman posted:

Hopefully everyone's already on the Big Nerd Ranch blog, but if not, they just posted about -isEqual: versus -isEqualToString:. (Spoiler: the author considers the choice "purely stylistic".)

I wish he would have tested different length strings though.

Toady
Jan 12, 2009

In my opinion, calling it purely stylistic is inaccurate in light of the improved type safety and declaration of intent, however slight they may be. I just can't come up with a reason not to use a class-specific equality method when the class is known.

AlwaysWetID34
Mar 8, 2003
*shrug*
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

AlwaysWetID34 fucked around with this message at 16:58 on Jan 18, 2019

Hog Obituary
Jun 11, 2006
start the day right

McFunkerson posted:

I've just got some vague details (GPS notifications, in app purchases, server side development.) They have someone to cover the art and the sounds, however it "isn't going to be art heavy". They want to get this out "soon" but are still talking about deadlines and budgets. I'm setting up a phone meeting to get more details on the project next week.

This sounds like it has disaster written all over it. I don't have too much to contribute except for you to be wary here. From what you describe, it seems like they're going to expect you to be able to crank this out in a matter of weeks for pennies.

I think a rough ballpark is supposed to be $100/hr though.

OHIO
Aug 15, 2005

touchin' algebra

McFunkerson posted:

Sorry if this is the wrong place for this but, I was wondering if anyone has any advice on what people charge for development. I have a couple of Mac Apps under my belt, and an iOS app that is getting close to release, but they have all been m y own projects. Right now I'm talking with an acquaintance of my wife's about an iPhone game they want to have made. I'm trying to get a better feel for the project, but right now I've just got some vague details (GPS notifications, in app purchases, server side development.) They have someone to cover the art and the sounds, however it "isn't going to be art heavy". They want to get this out "soon" but are still talking about deadlines and budgets. I'm setting up a phone meeting to get more details on the project next week.

My problem is, I've never done development work for anyone else and I don't really know where to start with the price. There has also been a mention of a percentage of sales. For those of you that do a lot of contract work would you rather get one fee upon completion, a percentage of sales, or a little bit of both? What's a fair rate to charge for iOS development?

You can charge $50-$200 an hour depending on how good you are (probably more but $200 is the highest I've heard someone regularly charging). I wouldn't go for a percentage of sales because odds are it's not going to make anything. Plus if you go by the hour they will be more cautious about asking you to add "just one more thing". Be sure to write everything out beforehand before you start working, including how and when you'll get paid.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Absolutely 100% under no circumstances should you take a percentage of sales in any proportion for any reason.

I'm a big fan of an hourly rate with solid time estimates for each part of the project. Keep very close track of your time on the project. As soon as you think you'll overshoot an estimate talk honestly to your client about where you are, how much more time it'll take, and what alternatives there are. I like hourly (as opposed to a flat rate for the project) because it protects you from the endless slide of changing requirements, and your client should like it because you won't overcharge them.

What should that hourly rate be? I have no earthly idea. Keep in mind two things: people tend to be equally comfortable with much higher business expenses than personal expenses (i.e. if a company's hiring you, you can charge more); and what cost are you saving (or money are you generating) for your client?

The business versus personal expense works both ways too. You can charge an amount that makes you think "wow, that's a lot for an hour's work", while the business thinks "we're saving so much money".

US$100/h is an entirely reasonable place to start if you're completely out of ideas. But ask around.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
This discussion reminds me of an awesome video someone showed me a couple of months ago, entitled, "gently caress you. Pay me."

https://vimeo.com/22053820

Good stuff for anyone doing contract work to hear.

duck monster
Dec 15, 2004

McFunkerson posted:

Sorry if this is the wrong place for this but, I was wondering if anyone has any advice on what people charge for development. I have a couple of Mac Apps under my belt, and an iOS app that is getting close to release, but they have all been m y own projects. Right now I'm talking with an acquaintance of my wife's about an iPhone game they want to have made. I'm trying to get a better feel for the project, but right now I've just got some vague details (GPS notifications, in app purchases, server side development.) They have someone to cover the art and the sounds, however it "isn't going to be art heavy". They want to get this out "soon" but are still talking about deadlines and budgets. I'm setting up a phone meeting to get more details on the project next week.

My problem is, I've never done development work for anyone else and I don't really know where to start with the price. There has also been a mention of a percentage of sales. For those of you that do a lot of contract work would you rather get one fee upon completion, a percentage of sales, or a little bit of both? What's a fair rate to charge for iOS development?

Pitch for $70 an hour if your just new to the game, and raise that to $100 once you have some experience. FIRST work out a detailed spec, at least with a "wireframe" drawing of the screens (Use something like balsamiq or whatever), and try and get some user stories (John enters blah into the yada screen, then the app says foobar, etc etc etc), so your CRYSTAL CLEAR on the job. Once you have agreed on the price, you need to then make it clear that any major changes will need either a varation on the contract or a reversion to per hour development billing.

Do not forget *anything* in the spec. Its the little things that bite. I learned that the hard way, and because i'm a dumb oval office, I still learn this the hard way.

hint: Go for internal-use business apps on ipads over games if your contract developing. Theres a tonne of games, and most actually understand business and won't flinch at quotes. Well wont flinch as much anyway. Its less fun, but you can specify a minimum platform of IOS5, so you can levearage storyboards and arc which will greatly reduce dev time, and you can develop a common codebase for ugly poo poo like sync etc (Ie my little stunt of deserializing json into a mutable dictionary, tweaking the dictionary and sending it back to the server.)

duck monster fucked around with this message at 03:22 on Mar 27, 2012

Doc Block
Apr 15, 2003
Fun Shoe
Oh hey, a new version of Xcode is out. I just can't wait to have to re-download all the iOS 4.3 and 5.0 stuff again because of a minor point release! :rolleyes: :argh:

xgalaxy
Jan 27, 2004
i write code

Doc Block posted:

Oh hey, a new version of Xcode is out. I just can't wait to have to re-download all the iOS 4.3 and 5.0 stuff again because of a minor point release! :rolleyes: :argh:

It was worse for me.
For some hosed up reason App Store kept saying 'Please signin with the account you used to purchase this.'

... and I only have one account.

So I had to uninstall everything, and re-download all 2 gigs of it.


Then it was failing to update the iOS command line tools, saying it couldn't mount such and such. UGH.

AlwaysWetID34
Mar 8, 2003
*shrug*
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

AlwaysWetID34 fucked around with this message at 16:59 on Jan 18, 2019

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
As long as we are wishing for ponies:

- I would love to have @overrides and @implements directives for methods and a compiler option to require them, then throw off warnings for any overriding method or optional protocol method that didn't match. This would catch a lot of the spelling errors and other nonsense and would help the code be immediately more readable and clear on intent. Eg if @implements -(void)blah didn't match any protocol methods the class implements it would be flagged (did you mean -(BOOL)blah ?)

- Likewise, for @overrides it would be nice to have some sort of solution for indicating that I did not call the base class method intentionally and flag all others as warnings. People constantly get tripped up by forgetting to forward viewWillAppear: on to the base controller and stuff like that.

- @abstract for methods that require a derived class to implement this. Not a huge priority but it would be nice.

- modules... Saw something about @imports and I can only hope that it isn't just for C++ 11 interop. It looked like the module definition would know what headers to include for the module too but I may be crazy.

- for that matter, an option to eschew headers entirely. I know this is an impractical pipe dream but it would be so increadibly cool if we had a compiler mode that just let us define @properties and methods as @private, @public, in the implementation file and indicate what module this file was in and have it just auto-generate the headers in the background.

- More UIKit but dear lord integrate RestKit and the object mapping with TableView support so I can just point at a web service, have it auto-cache to CoreData, and drag/drop in IB to hook up to the model. It would eliminate millions of lines of boilerplate code in over half the apps on the entire platform.

xgalaxy
Jan 27, 2004
i write code
Just a heads up. This was brought up on the last page.
Apple is not only denying UDID apps now, but they are also cracking down on MAC address usage.

So if you are planning on running towards MAC address in the wake of UDID, you are going to be disappointed.

duck monster
Dec 15, 2004

xgalaxy posted:

Just a heads up. This was brought up on the last page.
Apple is not only denying UDID apps now, but they are also cracking down on MAC address usage.

So if you are planning on running towards MAC address in the wake of UDID, you are going to be disappointed.

:sigh:

These rules feel capricious as hell sometimes.

Hey lets stop people from being able to identify apps to servers without forcing users to rembember complicated logon procedures FOR SOME REASON

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Can you generate a unique ID on first run and shove it in the keychain?

Hog Obituary
Jun 11, 2006
start the day right

pokeyman posted:

Can you generate a unique ID on first run and shove it in the keychain?

Well, Apple says to do the following:

quote:

Do not use the uniqueIdentifier property. To create a unique identifier specific to your app, you can call the CFUUIDCreate function to create a UUID, and write it to the defaults database using the NSUserDefaults class.

I suppose you could put it into the keychain as well though.

http://developer.apple.com/library/...niqueIdentifier

duck monster
Dec 15, 2004

Hog Obituary posted:

Well, Apple says to do the following:


I suppose you could put it into the keychain as well though.

http://developer.apple.com/library/...niqueIdentifier

Which all goes to hell whenever itunes or the iphone periodically nukes settings for no god drat reason at all. This is how I lost my pet wars character :mad:

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Yeah I suggested keychain because it (I think) sticks around after an app gets deleted, so it's a bit more persistent.

haveblue
Aug 15, 2005



Toilet Rascal
What's the best way to replicate Mac OS Classic's app switching behavior under Cocoa? Specifically, causing a click on any application window to bring all windows of the application to the front, without losing the ability to reorder them relative to each other.

I'm porting a very old codebase and I'd rather do this than completely rework the GUI, and preferably without a lot of hand munging in window delegate methods.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Without even opening the docs, I'd put a tap on all events delivered to the app, and if I'm not the active app, bring all my windows to the front (then pass the event along). This presumes you're maintaining a collection of windows somewhere.

haveblue
Aug 15, 2005



Toilet Rascal
Turns out this can be done with the class NSRunningApplication (apparently new in 10.6) and passing NSApplicationActivateIgnoringOtherApps | NSApplicationActivateAllWindows to activateWithOptions.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Oh yeah, forgot about that class. Good call!

duck monster
Dec 15, 2004

Hmm. I'm seemingly having a misunderstanding about mutabledictionaries and poo poo.

I have found a bit of a showstopper gaffe in some code where I have an array of dates, and under the struct with the dates is an event description. However sometimes there are multiple dates for an event, so realising that changing the event description in one should change it in the other, I have concluded the best aproach would be to just do something like this;-

code:
for (id item in appdelegate.data) {
        NSMutableDictionary * e = [[item objectForKey:@"fields"] objectForKey:@"event"];
        NSLog (@"%@",e);
        int pk = [(NSNumber *)[e objectForKey:@"pk"] intValue];
        for (id item2 in appdelegate.data) {
            NSMutableDictionary * e2 = [[item2 objectForKey:@"fields"] objectForKey:@"event"];
            int pk2 = [(NSNumber *)[e objectForKey:@"pk"] intValue];
            if (pk2 == pk) {
                e2 = e; // Does this work? I hope so.
                        // No it doesnt. gently caress.
            }
        }
    }
yeah its goofy and unefficient, but since its only relating to a at most 10-15 records , who gives a gently caress really.

However, it doesnt loving work. When I change a value in e, it doesnt reflect in e2 so even if its copying the reference across, they are still two different records. My pointer shenangigans have , in typical style for me, failed in vain.

Any ideas what I'm doing wrong here?

e: Ah gently caress it I know. DOH. When I write back, I'm writing a fresh new dictionary, and not updating pointers. I think I need to just run this code again and then make sure the "DIRTY" flag is being tested as well prior to copy.

duck monster fucked around with this message at 05:59 on Mar 30, 2012

Hog Obituary
Jun 11, 2006
start the day right
As far as I can tell you're not writing your data back to the dictionary at all. Is that what you meant by your update?

Instead of
code:
e2 = e
You need to do
code:
[[item2 objectForKey:@"fields"] setObject:e forKey:@"event"]
In fact, "e2 = e" is basically doing nothing since e2 is never ever read.

duck monster
Dec 15, 2004

Yeah yeah your right. I thought e2 was a pointer to the data, but apparently not.

Im not sure your suggestion works either though, because on further reading fast enumeration throws on a mutation lock. I wonder if I can defeat that lock and just let my nuts hang in the wind a bit here.

e: Ok, I got it now.

In my write-back method after the user has tweaked the responses (rather than in my initial setup code) I have this;-

code:
    [self.currentrecord setObject:rec forKey:@"fields"];//Ahhhhhhhhhhhh
    int pk = [(NSNumber *)[self.currentrecord objectForKey:@"pk"] intValue];
    AAAppDelegate* appdelegate = getDelegate();

    NSLog(@"%@",appdelegate.data);
    NSEnumerator *e = [appdelegate.data objectEnumerator];
    id item2;
    while(item2 = [e nextObject] ) {
        NSLog(@"%@",item2);
        id e2 = [[item2 objectForKey:@"fields"] objectForKey:@"event"];
        int pk2 = [(NSNumber *)[e2 objectForKey:@"pk"] intValue];
        if (pk2 == pk) {
            [[item2 objectForKey:@"fields"] setObject:self.currentrecord forKey:@"event"];
            //[self.data objectForKey:
            //[[item2 objectForKey@"pk"] 
        }
    }
So I use a traditional enumerator rather than a fast enumerator.

One side effect is that mutating a record from NSEnumeration is officially taboo, but gently caress it, it works so whatever.

duck monster fucked around with this message at 07:14 on Mar 30, 2012

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



If I understand your data structure right, this works:

code:
NSNumber *pk = [self.currentrecord objectForKey:@"pk"];

for(id item in [appdelegate.data objectEnumerator]) {
	if ([[item valueForKeyPath:@"fields.event.pk"] isEqual:pk]) {
		[[item objectForKey:@"fields"] setObject:self.currentrecord forKey:@"event"];
	}
}
See also http://pastebin.com/nBUDESMX

Edit: It's only bad to mutate the object doing the enumeration, we're changing an object contained in that, which will have no effect on the integrity (presuming there aren't sideeffects, but since this is dictionaries, there aren't).

Edit2: Is there a reason that pk isn't a key in the dictionary? It's being used as a key what with all the comparing to it, after all.

Carthag Tuek fucked around with this message at 09:30 on Mar 30, 2012

duck monster
Dec 15, 2004

Carthag posted:

If I understand your data structure right, this works:

code:
NSNumber *pk = [self.currentrecord objectForKey:@"pk"];

for(id item in [appdelegate.data objectEnumerator]) {
	if ([[item valueForKeyPath:@"fields.event.pk"] isEqual:pk]) {
		[[item objectForKey:@"fields"] setObject:self.currentrecord forKey:@"event"];
	}
}
See also http://pastebin.com/nBUDESMX

Edit: It's only bad to mutate the object doing the enumeration, we're changing an object contained in that, which will have no effect on the integrity (presuming there aren't sideeffects, but since this is dictionaries, there aren't).

Edit2: Is there a reason that pk isn't a key in the dictionary? It's being used as a key what with all the comparing to it, after all.

The whole thing is a deserialization from a Django based server shat out over a http connection and into TouchJSON , and then made mutable with the DeepMutableCopy hack we talked about earlier. yeah its wierd, but thats how it comes out.

This by the way is why I prefer to do in-house apps for use in companies rather than stuff that goes on the App Store. I can pull off stupid hacks and be a bit less worried about insane people using the app in insane ways. Well there are still insane people, but just less of them, and I get to train them personally and pull hypno-toad poo poo on them about the grave undesirability of upsetting the contract coder with stupid useage patterns.

e: The reason your code wont work is that the root level is a bunch of date records with the event record being contained within them. The problem is that sometimes it refers to the same record where an event has multiple dates, meaning that when its sent back to the server for sync theres conflicting versions of the record once its put back into sane database normalised format. If I wasn't a lazy oval office whos under pressure to do corporate apps in 2 week deadlines I'd have used core data to create a proper representation of the data. But I'm a lazy oval office so instead I'm just loving with the deserialized JSON and firing it back at the server where properly representing the data is a lot easier because django/python is a tonne easier to deal with than C.

e2: It would have been more correct to have sent the data with event->date, but the lovely calendar display library I pulled off github makes it a harder structure to deal with. At least on the deadline and bone-lazy design style I've been using (aka "work it out in my head and implement it cowboy style" which is a method that TOTALLY never fucks up nastily)

duck monster fucked around with this message at 10:42 on Mar 30, 2012

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



I don't understand why it won't work. It literally does the same as your code did inside the loop, just with a keypath instead of going objectForKey: multiple times, and not unboxing the primary key, since that's not needed when NSNumber has an isEqual: method.

duck monster
Dec 15, 2004

Ahhhh I didn't know about the keypath thing. Tha thing just seemed wierd and impausible to me, but I tried it and it workd.

Cocoa, you never fail to amaze me.

haveblue
Aug 15, 2005



Toilet Rascal

Carthag posted:

Edit: It's only bad to mutate the object doing the enumeration, we're changing an object contained in that, which will have no effect on the integrity (presuming there aren't sideeffects, but since this is dictionaries, there aren't).

If you want to get pedantic, you are only allowed to mutate a contained object in such a way that its response to hash does not change. If you rely on the NSObject implementation of that method you are almost always in the clear (I think it just uses the object's memory address) but if you overrode this to depend on custom internal state and its return changes, the containing object will most certainly get confused.

(Same goes for isEqual if you overrode that as well.)

haveblue fucked around with this message at 15:00 on Mar 30, 2012

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



I was mostly thinking about things like adding objects to an array while we're enumerating it.

Also Key-Value coding is definitely worth looking into if you're unfamiliar with it. You can do some pretty clever things.

LP0 ON FIRE
Jan 25, 2006

beep boop
I keep on getting pngcrush errors in Xcode (app builds anyway) from png images I saved for web and devices from Photoshop. They are transparent and NOT interlaced. I re-saved as png's in preview like the threads on StackOverflow suggested to no avail. Even though my app builds, it's only every so often that the build displays the images correctly.

edit: I had the same files in another directory in resources.. That'll do it.

LP0 ON FIRE fucked around with this message at 20:25 on Mar 30, 2012

Doc Block
Apr 15, 2003
Fun Shoe
What's the difference between just plain ol' Save and Save For Web And Devices? If you're saving to a PNG, is there a difference?

ModeSix
Mar 14, 2009

Doc Block posted:

What's the difference between just plain ol' Save and Save For Web And Devices? If you're saving to a PNG, is there a difference?

This seems more of a Photoshop related question.

Save just saves it with all layer and meta data intact.

Save for web/device removes all the meta data that whatever application you're using to edit the image file throws in.

ex: If you create and image of a simple square with a border in Firework and save it, it will create an image file about 150kb in size. It is preserving all meta data for individual layers and objects for future editing within Fireworks.

If you open the file in Photoshop and Save for Web/Device it creates a file about 2kb in size, because it has stripped all the application specific metadata from the image and is producing only the raw data for the image.

tl;dr - Save is like making a PSD, save for web is like making a jpg

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Excerpt use png instead of jpg

duck monster
Dec 15, 2004

Doc Block posted:

What's the difference between just plain ol' Save and Save For Web And Devices? If you're saving to a PNG, is there a difference?

Not an IOS question, but anyway. PNG is actually a really cool format where a program can put a tonne of metadata into it without compromizing the basic functionality as picture format. The end result is that something like Fireworks can use PNG as its major file format for editing, but you can open the result in just about anything.

The downside however is that these files can get unreasonably huge.

Incidently, Fireworks is a loving amazing piece of software for web and UI development that really neatly hits that middleground between photoshops image centricism and illustrators vector centricism and nowdays I really only use photoshop and illustrator for stuff clients give me, or things where theres a clear advantage (like actually editing photos, or illustrator for loving with logos etc). The standard library has a tonne of really useful re-useable styles.

Now with all this said, its a bit *too* easy to just leave your files uncrushed in apps and end up with a tonne of bloat, but tools like pngcrush on a batchscript in your build stage can be very very useful in this regard.

Adbot
ADBOT LOVES YOU

lord funk
Feb 16, 2004

Sweet jesus. Just had my first real run in with Git problems. The Xcode project wouldn't parse, had to resolve conflicts manually on two different branches... nearly gave me a heart attack when it started to get ugly. I thought this would be a good way to leave the current App Store version of the app available for bug fixes, while still adding new features for the next version. But man... what a shitstorm I just went through.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply