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
Small White Dragon
Nov 23, 2007

No relation.

deep square leg posted:

For the first part, I had believed that even personal apps could still only use whatever functionality was available in the API, and I wasn't sure if the kind of thing I want to change would be available. I'll do some research.

For the second, I assumed I'd be waiting until an iPad 2 jailbreak became available, but my concern was still that everything on the filesystem would still be compiled in such a way to make alteration difficult. Again, I'll look into it.
Just keep in mind your application is going to run as a regular user and not root. That said, there are a lots of interesting things you can do by poking around in the Private Frameworks and other such areas.

In any case, if you just want to look around the iOS filesystem without actually jailbreaking, there are tools to do that.

Adbot
ADBOT LOVES YOU

LP0 ON FIRE
Jan 25, 2006

beep boop
So I've successfully displayed a 100+ CCSprites using Cocos2D running around 60fps on an iPad 2, all with independent behaviors, but all created from the same sprite class. Though it's running nicely, I can't check with leaks if it is leaking because it doesn't run when I try to use it. It just loads for about 10 seconds with the white screen and then quits out. Otherwise, without leaks in the simulator it works fine. Eventually I'll have to figure out how to fix this, but until then, I want to know if the way I'm coding this is okay in terms of not leaking, etc.

First off, in my main CCLayer class that makes the zone and places the sprites, I import my sprite class in the header, pointers to arrays, and stuff:

code:
#import "HummingClass.h"
@class HummingClass;

@interface DebugZoneLayer : CCLayer {
	
	HeroControl *heroControl;
	
	HeroClass *hero;
	
	NSMutableArray *hummingBirds;
	NSMutableArray *hummingBirdLabels;
	
	CCLabelTTF *label;
	
	CCTMXTiledMap *theMap;
	CCTMXLayer *blocksCollidable;
	CCTMXLayer *blocksCollidable2;
	CCTMXLayer *invisiblePropertiesLayer;	
}

@property(nonatomic, retain) NSMutableArray *hummingBirds;
@property(nonatomic, retain) NSMutableArray *hummingBirdLabels;
*Note that there's other properties defined, but I'm really just concerned with the humming birds in this post.

In .m I synthesize hummingBirds and hummingBirdLabels. What I'm doing in init I think is the more major thing that I'm concerned with, because I don't know if it's okay. And I know it looks weird, partly because this is just a test and I haven't made the bridge yet between this and Tiled so it can count and pass the locations of all these sprites. Right now, it's just using one location and shifting the x coordinate for each sprite. I changed up the code a bit because it did display a rectangular matrix of sprites to test how many I could use on screen at once, but I didn't want to make this post even more confusing. Sorry I'm not using code tags here, just want to show the important stuff in bold:


hummingBirds = [[NSMutableArray alloc] initWithCapacity: hummingBirdsMax];
hummingBirdLabels = [[NSMutableArray alloc] initWithCapacity: hummingBirdsMax];


for(int i=0; i<hummingBirdsMax; ++i){

HummingClass *humming = [[HummingClass alloc] init];

[hummingBirds insertObject:humming.hummingSprite atIndex:i];



startPoint = [objects objectNamed:@"HummingStart"];
x = [[startPoint valueForKey:@"x"] intValue];
y = [[startPoint valueForKey:@"y"] intValue];


CCSprite *tempSp;

tempSp = [hummingBirds objectAtIndex:i];


tempSp.position = ccp(x+(i*100),y);

[self addChild:humming.hummingSpriteSheet];


CCLabelTTF *hummingBirdLabel;

hummingBirdLabel = [CCLabelTTF labelWithString:@" " fontName:@"Arial" fontSize:15];
hummingBirdLabel.color = ccc3(0,0,0);
hummingBirdLabel.position = ccp(tempSp.position.x, tempSp.position.y+26);
[self addChild:hummingBirdLabel z:10];

[hummingBirdLabels insertObject:hummingBirdLabel atIndex:i];

deactivateLabelToggle[i] = 0;

deactivateLabelCounter[i] = 0;

[humming release];

}



I expect to get a ton of grief for this, but unfortunately I'm still a tremendous newbie with this kind of stuff. In the loop, I'm allocating humming over and over but releasing it each time. I put each humming bird into an array index. This is how I reference it later by making temporary pointer to a CCSprite and then making that equal an array index. I release the arrays in dealloc. So I'm wondering if thats okay.

The other thing I'm wondering about is that I'm doing [self addChild:humming.hummingSpriteSheet]; every time in the loop which I found was necessary to see each one of these.

Small White Dragon
Nov 23, 2007

No relation.
Xcode 4.2? :allears:

klem_johansen
Jul 11, 2002

[be my e-friend]
There has got to be a simpler way to implement QR code recognition in PhoneGap. So far I'm loving it as a development environment for quick prototyping but the instructions for implementing ZBar/QR decoding leads me to a morass of errors and apparent version conflicts. I'm trying to stick with PhoneGap because it should make porting to Android easier, which is a little ironic since Android has some QR functions built in from what I understand.

Any ideas?

gabensraum
Sep 16, 2003


LOAD "NICE!",8,1

Small White Dragon posted:

Just keep in mind your application is going to run as a regular user and not root. That said, there are a lots of interesting things you can do by poking around in the Private Frameworks and other such areas.

In any case, if you just want to look around the iOS filesystem without actually jailbreaking, there are tools to do that.

Excellent, thanks a lot.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!
If anyone with a decent knowledge of iOS dev is interested in making a few bucks, the developers of a budget arcade-ish PC game want to port to iOS and are seeking a contractor to finish it up. I'm under the impression that a lot of the hard stuff (i.e. renderer) is already ported and the main thing that needs to be ported is the input handling, which is using SDL. It's written in C, the job's a paid contract, part time, remote, and the game itself was created as a side project so it'll probably be pretty accommodating to your schedule. Rate's negotiable.

Send me a PM or e-mail ejlasota@gmail.com with your resume and I'll forward it along.

klem_johansen
Jul 11, 2002

[be my e-friend]
[nevermind]

klem_johansen fucked around with this message at 03:44 on Jun 9, 2011

BigRedDot
Mar 6, 2008

Hi all, I have been doing unix C++ the last 10 years, I'm brand new to iOS and objective-C, so hopefully this is actually a really simple, dumb problem.

I am converting an existing iPhone app to a universal app. The original basic structure is a tab bar controller with some navigation controllers that show master/detail. I have used Matt Gemmell's lovely MGSplitViewController in order to show all the master/detail at once for each tab. This all works great in portrait orientation, but after rotations the layout gets all screwed up. I think the problem is that
code:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
and similar methods are not getting called on the MGSplitViewController. (That is: I know they are not getting called, and I think that is the problem)

All of the views return YES for shouldAutorotateToInterfaceOrientation, I've tried explicitly setting autoResizesSubviews to YES on these programmatically constructed view. Some digging suggests that the reason is that only the root view controller gets these rotation notifications. Anyone have any suggestions?

lord funk
Feb 16, 2004

How can I monitor how hard the iPhone processor is working while my app runs?

Small White Dragon
Nov 23, 2007

No relation.

lord funk posted:

How can I monitor how hard the iPhone processor is working while my app runs?
"Instruments" can do it.

lord funk
Feb 16, 2004

Small White Dragon posted:

"Instruments" can do it.

Oh :doh: why didn't I think of that.

xelfer
Nov 27, 2007

What's new, Buseycat? woa-aah, woa-aah, woa-aah
Is anyone developing on OSX inside VMWare on Windows 7? Since updating to iOS5 I can't seem to share my phone from the host system to the VM, it doesn't even see the USB device.

Just wondering if anyone has managed to get it working somehow, simulator only testing / using testflightapp every time I change something is getting annoying. :)

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
I wish it was easier to run OS X under VMWare Fusion on Apple hardware... I'd love to test the new iOS5 and Xcode stuff but I means putting my current development system at risk by installing beta software. In theory it shouldn't matter to Apple since their main concern is selling the hardware (which I already own).

xelfer
Nov 27, 2007

What's new, Buseycat? woa-aah, woa-aah, woa-aah

Ender.uNF posted:

In theory it shouldn't matter to Apple since their main concern is selling the hardware (which I already own).

Yeah I agree, I used to develop on my 2007 black macbook, but now OSX in VMWare on my i7 compiles faster than my macbook so I just use that.

Echo Video
Jan 17, 2004

whooooooo my first app is now on the app store: http://t.co/kEX8Vj0

it's free so you can all download it if you want. I haven't been posting in this thread, but I've been reading it to learn stuff.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

xelfer posted:

Yeah I agree, I used to develop on my 2007 black macbook, but now OSX in VMWare on my i7 compiles faster than my macbook so I just use that.


Does anyone know off-hand if you have a beta xcode+sdk installed but target the latest official SDK, are there any problems submitting updates to the App Store?

Small White Dragon
Nov 23, 2007

No relation.

Ender.uNF posted:

Does anyone know off-hand if you have a beta xcode+sdk installed but target the latest official SDK, are there any problems submitting updates to the App Store?
Apple employees elsewhere have stated this is not allowed. And in case you're curious, the output tells what version of Xcode you used to build it.


EDIT: You can, however, install a release and beta SDK simultaneously (and this is what they recommend).

Small White Dragon fucked around with this message at 01:34 on Jun 11, 2011

klem_johansen
Jul 11, 2002

[be my e-friend]
anybody know why an app would exit on suspend even though "exit on suspend" is set to no in the info.plist? I'm using the newest version of PhoneGap. It suspends fine in the simulator but on the device it restarts after I hit the button and then touch the icon again.

Yakattak
Dec 17, 2009

I am Grumpypuss
>:3

klem_johansen posted:

anybody know why an app would exit on suspend even though "exit on suspend" is set to no in the info.plist? I'm using the newest version of PhoneGap. It suspends fine in the simulator but on the device it restarts after I hit the button and then touch the icon again.

Memory would be a logical reason I believe.

blorpy
Jan 5, 2005

Hi, this is my first time posting in this thread and I'm just getting started with iOS dev. I'm quite familiar with C and have done a lot of low-level programming as well as some web stuff with Django, but this is my first time doing anything with Obj-C or Apps.

If I am writing an asynchronous, two-player game like Chess, would it be kosher to use push/APN to alert players that the other player has moved? Assume for the sake of argument here that I'm connecting to a backend to handle all the game stuff. It seems like one alternative would be to just keep a socket open while the app is running to get any new moves but I can't tell if this would scale quite as nicely. I realize this might just be premature optimization so apologies if I come off that way.

Also, if I wanted to make sure that the only thing connecting to my backend is my app, is there a reasonable way of doing so? This is definitely not an actual requirement but as I'm putting my ideas together I feel that this would be nice to have.

Thanks!

chimz
Jul 27, 2005

Science isn't about why, it's about why not.

Markov Chain Chomp posted:

If I am writing an asynchronous, two-player game like Chess, would it be kosher to use push/APN to alert players that the other player has moved?

Sure. Check out how Words With Friends does it for Scrabble. You're actually not allowed to sit there with an open socket in the background for very long at all, so you should use APN instead. (Go read the docs on iOS multitasking and app backgrounding. It's got a few restrictions you'll need to plan for. )

Also I think there is turn-based game support in Game Center for iOS 5, so you should look that up if you're interested.

Markov Chain Chomp posted:

Also, if I wanted to make sure that the only thing connecting to my backend is my app, is there a reasonable way of doing so?

You can use a password or a certificate or something to impede hackers, but it's basically impossible to be totally sure that your app is intact. You should always put all verification and game rule code etc on the server side.

blorpy
Jan 5, 2005

chimz posted:

Sure. Check out how Words With Friends does it for Scrabble. You're actually not allowed to sit there with an open socket in the background for very long at all, so you should use APN instead. (Go read the docs on iOS multitasking and app backgrounding. It's got a few restrictions you'll need to plan for. )

Also I think there is turn-based game support in Game Center for iOS 5, so you should look that up if you're interested.


You can use a password or a certificate or something to impede hackers, but it's basically impossible to be totally sure that your app is intact. You should always put all verification and game rule code etc on the server side.

Cool, I'll check all that out. I've been trying to get through all the relevant documentation. It's pretty cool how much of it there is, but it can take a bit to soak it all in. I haven't had a chance to look at iOS 5 yet, seems like I picked somewhat of a transitional time to get started on this stuff.

As far as the app verification thing goes, I want to use location/gps information from the phone and I'd prefer it if people couldn't easily inject fake locations, but when it comes down to it it's just a game so who cares if someone spoofs packets to appear at the north pole, right?

Small White Dragon
Nov 23, 2007

No relation.

Markov Chain Chomp posted:

As far as the app verification thing goes, I want to use location/gps information from the phone and I'd prefer it if people couldn't easily inject fake locations, but when it comes down to it it's just a game so who cares if someone spoofs packets to appear at the north pole, right?
Unless your app is incredibly popular, I'd consider it far more likely that someone who jailbroke would modify the location data on the phone rather than try and hack your app to submit something other than what the phone sees.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

I have two beginning Mac programming books, but neither of them cover dragging a file onto an app (the actual app, not the dock icon). I'm trying to do something where you could drag a URL from a browser's address bar onto a UIView of some sort (or a link, like if you dragged a torrent URL into a Torrent client, and it started downloading it automatically).

Where should I start?

dizzywhip
Dec 23, 2005

This should be a good place to start: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html

I've never worked with drag and drop, but from what I understand it's closely linked to the copy paste system.

Mikey-San
Nov 3, 2005

I'm Edith Head!

Bob Morales posted:

I have two beginning Mac programming books, but neither of them cover dragging a file onto an app (the actual app, not the dock icon). I'm trying to do something where you could drag a URL from a browser's address bar onto a UIView of some sort (or a link, like if you dragged a torrent URL into a Torrent client, and it started downloading it automatically).

Where should I start?

Introduction to Drag and Drop

e:f,b

ModeSix
Mar 14, 2009

Any Canadian goons here have any experience dealing with Apple regarding Canadian GST/HST tax forms?

I sent in my completed forms quite a while ago, and today I received the form back from Apple for "Election and Revocation of an Election Between Agent and Principle".

It was signed and notarized by someone at Apple but has been returned to me. My Canadian tax status on iTunes connect still does not show that anything has been done.

Of course the "Contact Us" option on iTunes connect just puts me through an endless loop of crap and doesn't help, just like for everything else in that waste of time.

Does anyone have any suggestions?

Echo Video
Jan 17, 2004

ModeSix posted:

Any Canadian goons here have any experience dealing with Apple regarding Canadian GST/HST tax forms?

I sent in my completed forms quite a while ago, and today I received the form back from Apple for "Election and Revocation of an Election Between Agent and Principle".

It was signed and notarized by someone at Apple but has been returned to me. My Canadian tax status on iTunes connect still does not show that anything has been done.

Of course the "Contact Us" option on iTunes connect just puts me through an endless loop of crap and doesn't help, just like for everything else in that waste of time.

Does anyone have any suggestions?

I think all that means is that they've received the form and it's all good. I also can't see anything more about the canadian forms on iTunes Connect (nothing more than when I sent it the forms myself), but the paid applications contract is in effect and it looks like I should be able to submit paid apps.

ModeSix
Mar 14, 2009

Echo Video posted:

I think all that means is that they've received the form and it's all good. I also can't see anything more about the canadian forms on iTunes Connect (nothing more than when I sent it the forms myself), but the paid applications contract is in effect and it looks like I should be able to submit paid apps.

Therein lies the problem. When I check my tax status on iTunes connect, it doesn't show that my Canadian tax forms have been accepted. The US tax forms were a breeze, fill out online and done, but these Canadian tax forms are driving me nuts.

My paid apps contract is in effect, but that happened as soon as I did the US tax forms online on iTunes Connect, however when reading it says if I don't get the Canadian forms processed I won't get paid for sales in Canada, which is a problem because I am developing a Canada-centric application.

Is there actually any way to contact them about this? The useless "contact us" option is just that, useless.

ModeSix fucked around with this message at 07:53 on Jun 15, 2011

Vinlaen
Feb 19, 2008

Are there any good videos on learning Objective-C and the Cocoa/iOS framework?

I'm a fairly experienced .NET developer but sometimes I find concepts easier to learn watching/listening to somebody rather than read books, etc.

However, I'd also like suggestions on a good book for an experienced developer on learning Objective-C (instead of a book that is for a new programmer, etc).

Doc Block
Apr 15, 2003
Fun Shoe
AFAIK the book Learn to Program Objective-C on the Mac assumes you already know C or C++.

edit: so does Beginning iPhone 4 Development or whatever it's called. It's for iOS 4 though, and won't have any of the new iOS 5 stuff, but neither will any other book for a while.

edit2: all the books out there also seem to still be for Xcode 3.x

Doc Block fucked around with this message at 16:42 on Jun 15, 2011

OHIO
Aug 15, 2005

touchin' algebra

Vinlaen posted:

However, I'd also like suggestions on a good book for an experienced developer on learning Objective-C (instead of a book that is for a new programmer, etc).

I know this isn't a book but Apple has a nice primer on Objective-C.

Echo Video
Jan 17, 2004

ModeSix posted:

Therein lies the problem.

well I found this: http://www.iphonedevsdk.com/forum/business-legal-app-store/9615-itunes-connect-canada.html

that says that worst case, not having the forms won't mean the app won't get approved, it just means that you might had a delay in payment until it does get sorted out. You could try calling the developer hotline at 1-800-633-2152, if you haven't already.

baronmasochist
Jan 17, 2004

colors

Vinlaen posted:

Are there any good videos on learning Objective-C and the Cocoa/iOS framework?

I'm a fairly experienced .NET developer but sometimes I find concepts easier to learn watching/listening to somebody rather than read books, etc.

However, I'd also like suggestions on a good book for an experienced developer on learning Objective-C (instead of a book that is for a new programmer, etc).

Get yourself a iOS developer account with apple and start reading through the resources there. There's been a ton of recent changes that won't be in any book, and you'll really want to be on top of what's state of the art before reading old code in a book or online somewhere else.

ModeSix
Mar 14, 2009

Echo Video posted:

well I found this: http://www.iphonedevsdk.com/forum/business-legal-app-store/9615-itunes-connect-canada.html

that says that worst case, not having the forms won't mean the app won't get approved, it just means that you might had a delay in payment until it does get sorted out. You could try calling the developer hotline at 1-800-633-2152, if you haven't already.

Thank you. I'll give them a call right now to see what's what.

edit: That number while helpful, isn't the right number, but the agent I spoke with said he is going to contact the proper department, as they have no direct phone number.

ModeSix fucked around with this message at 23:24 on Jun 15, 2011

lord funk
Feb 16, 2004

Hacky question ahoy:

Is there a way to do a find / replace on a .txt file while an iOS app is running? As in, part of my app loads data from "thefile.txt" and before it does so I want to find / replace a series of strings.

If that's possible it will save me miles of work.

OHIO
Aug 15, 2005

touchin' algebra

lord funk posted:

Hacky question ahoy:

Is there a way to do a find / replace on a .txt file while an iOS app is running? As in, part of my app loads data from "thefile.txt" and before it does so I want to find / replace a series of strings.

If that's possible it will save me miles of work.

You can write to your /documents folder inside your app. So on the first run, copy 'thefile.txt' to your /documents, then always load that file from /documents and edit it as necessary.

lord funk
Feb 16, 2004

OHIO posted:

You can write to your /documents folder inside your app. So on the first run, copy 'thefile.txt' to your /documents, then always load that file from /documents and edit it as necessary.

Great - thanks.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
So everyone who can should check out automatic reference counting, because it looks fantastic. It's like fake garbage collection! (I say this based entirely on the commit to the public llvm repository and in no way on anything under NDA.)

Adbot
ADBOT LOVES YOU

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

pokeyman posted:

So everyone who can should check out automatic reference counting, because it looks fantastic. It's like fake garbage collection! (I say this based entirely on the commit to the public llvm repository and in no way on anything under NDA.)

Just to be clear, ARC itself is no longer under NDA, q.v., so you can run wild.

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