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
OHIO
Aug 15, 2005

touchin' algebra

smug forum rear end in a top hat posted:

I need help with something basic:

In the sample MoveMe app that Apple provides, the AppDelegate implementation starts off with a different method and return type:
code:
-(void)applicationDidFinishLaunching:(UIApplication *)application
than I get when I create a new project in Xcode 4:
code:
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
The books I'm trying to learn from also start with the one that returns void, which is apparently some older boilerplate code that's no longer in use? Can someone explain this difference? I really want to move on, but I'm hesitant to do so because I wonder what else may be different, and I don't want to get off on the wrong foot.

I hope I've been clear enough. Thanks :unsmith:

Don't worry about it! The -didFinishLaunchingWithOptions is what Apple recommends now, but wasn't introduced until iOS 3.0, so older tutorials won't have it.

It lets you handle fancy remote notifications and stuff, but really don't worry about it for now, just return YES and it'll be the same as -didFinishLaunching

You sound like you care about details and understanding the fine points, which is awesome, so if you want more info read up on both of those methods in the documentation.

Adbot
ADBOT LOVES YOU

OHIO
Aug 15, 2005

touchin' algebra

Xenomorph posted:

Can I install Xcode 4 over Xcode 3 and keep using the iOS 4.2 SDK??

You should be compiling with the latest SDK, but you can set your "Deployment Target" to something earlier so you can run it on your phone.

OHIO
Aug 15, 2005

touchin' algebra

Xenomorph posted:

It let me pick "iOS 4.3" or "Latest iOS (4.3)". No option for anything earlier. I of course got an error when it put the app on my phone, since I'm not running 4.3/4.3.1

When you change the deployment target you'll get more options for "Run", check out these screenshots (Xcode 4)





but poo poo you're using Xcode3, I think you'd have to go into the Project Settings? iOS 2.0 is ancient, you'll learn the fundamentals but there's been a ton of changes/improvements.

OHIO
Aug 15, 2005

touchin' algebra
Hey guys I'm at Voices that matter this weekend, are any of you attending?

OHIO
Aug 15, 2005

touchin' algebra

NOG posted:

Thanks. I'm going to see how a per-frame basis works out and how much I can push it.

Does anyone know if ccTime checks on a per frame? Even after looking it up on the Cocos2D site, I can't really find out much info about it.

Just calling this in init: [self schedule:@selector(update:)];

And this as a method

code:

- (void)update:(ccTime)dt {
	NSLog(@"test");
}

The "dt" will be the time since the last call. So if you're updating position it should look like
code:
position = speed * dt;

OHIO
Aug 15, 2005

touchin' algebra

NOG posted:

So how can you have a method checked every frame?

edit: Also found a really extensive tutorial on box2D that I'm going to read up on.
http://www.raywenderlich.com/606/how-to-use-box2d-for-just-collision-detection-with-cocos2d-iphone

Yeah that will be every frame, cocos2d will hook into CADisplayLink if it can.

OHIO
Aug 15, 2005

touchin' algebra

Bob Morales posted:

Beginner question:

Let's say you're making a falling blocks game, using UIKit. For a 10 square by 10 square game field, would you make an array of UIImageViews, or would you just make an array of a 'block' struct/objects?


For UIKit I'd use UIImageView, because it's so easy and you can tap into sweet UIView animations.

However if you're going to have a ton of objects on the screen moving around and you want to have accurate positional info about them you might want to use OpenGL (cocos2d is pretty great). It's more helpful for "real-time" games. (as opposed to turn-based)

OHIO
Aug 15, 2005

touchin' algebra
Tapjoy's going down (maybe), if you don't know about it, it's like those "sign up for these free trial offers to get a new iPod!"

http://www.tuaw.com/2011/04/19/apple-banning-pay-per-install-apps-from-the-app-store-says-tapjo/

I'm glad I avoided that bullshit, do anyone of you have any inside info about this?

OHIO fucked around with this message at 16:47 on Apr 19, 2011

OHIO
Aug 15, 2005

touchin' algebra

modig posted:

^^ Sorry no idea ^^

Does the TV out in the simulator just not work or something? Every time I activate it my App quits back to the main iPhone screen and the debugger says "Terminating in response to SpringBoard's termination.
"

It's not just my App, I downloaded the "Touches" sample code App and the same thing happens with that. I also commented out the internals of all the functions that have anything to do with adding a new screen, and the same thing happens.

Have you tried having the TV out open in the simulator before starting your app?

OHIO
Aug 15, 2005

touchin' algebra

modig posted:

Now I've actually done this, and it seems to work so far. Thanks.

So now I need to assign a view to the second display. Should I create a new ViewController for the second display? Then if I want to have the second display respond to say a button press on the iPhone's ViewController, should I message the AppDelegate and have the AppDelegate message the second view controller? That seems sort of inefficient. Currently the window (iPhone) and secondWindow (TV) are properties of the AppDelegate. Maybe I should pass the secondWindow (or at least it's view property?) object to the primary ViewController?

What do you want to do with the second display?

Speaking of external displays, I had some custom code to show some stuff on it back on iPad 1, but I've been getting reports of that breaking the cool iPad2 external mirroring feature. Is this a known conflict or is my code just bad? How can I detect if they're doing the iPad2 mirroring?

OHIO
Aug 15, 2005

touchin' algebra
Some patent troll is asking for licenses on people using in-app purchases: http://cultofmac.com/ios-devs-under-fire-by-patent-troll-for-offering-in-app-purchases/94916

I hope Apple helps him out, I don't know what the gently caress I'd do.

OHIO fucked around with this message at 17:43 on May 13, 2011

OHIO
Aug 15, 2005

touchin' algebra

mmm11105 posted:

Two quick questions for anyone who may know:

1.How well do HTML to iOS techs like phonegap and appcelerator work. Which is better/what do I have to watch out for?

2.What's the best way to do a small scale local deploy? A restaurant owner I know is planning on doing iPad menus with me making the app(hopefully in HTML). Do I need a enterprise license for a small scale (20-30 devices) deploy, or can this be accomplished with a regular account.

Why not just make a website if that's your skill set? The iPad can use websites no problem.

You get 100 devices for a regular account.

OHIO
Aug 15, 2005

touchin' algebra

OHIO posted:

Some patent troll is asking for licenses on people using in-app purchases: http://cultofmac.com/ios-devs-under-fire-by-patent-troll-for-offering-in-app-purchases/94916

I hope Apple helps him out, I don't know what the gently caress I'd do.

Apple is not going to stand for the in-app-purchases patent troll! http://www.macworld.com/article/160031/2011/05/apple_legal_lodsys_letter_text.html

OHIO
Aug 15, 2005

touchin' algebra

Lumpy posted:

Double checking something I am 99.999998% positive of: I have a client who I am building an app for, who does not won a computer, only an iPad. When I generate an Ad Hoc build .ipa file, there is no way to install this on a device w/o using a computer and iTunes, right? (I know it's possible w/ jailbreaking and whatnot, but his device isn't jailbroken, nor do I wish to go down that path.)


Given that without a machine of his own, he'd have to hook his iPad up to a friend's computer, which would then sync his device to that machine upon installing the app, which is also not desirable, so the best solution is probably for him to buy a cheap-rear end netbook or something?

You can distribute your adhoc builds from a website. I have my clients visit a page on their device and it installs it no problem, no syncing, no iTunes.

I use https://github.com/TheRealKerni/HockeyKit - just the server-side stuff though, I haven't messed with the client-side autoupdating functionality.

OHIO
Aug 15, 2005

touchin' algebra

Bob Morales posted:

Anyone have ideas (or even have this problem) on preventing peoples fingers from getting 'lost' on the touch screen in games?

A lot of games set the iPhone up like a video game controller, arrows on the left bottom corner and buttons on the right... Very frustrating.

I agree, but ideally you could design the game around a touch interface and not put in a fake game controller.

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.

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.

OHIO
Aug 15, 2005

touchin' algebra

NOG posted:

I'm including the header of the subclass in the class I'm using it with if that's what you're asking.

Is the class @interface defined in that header? Or in the .m file?

OHIO
Aug 15, 2005

touchin' algebra

Yodzilla posted:

I've inherited an iPhone app and I've got maybe 12 hours of experience in Xcode 4 and Objective C so I'm kind of stuck slamming my head against a wall for some issues I've encountered. The biggest problem I'm having is figuring out the best way to display the contents of an RSS or XML feed in a nice dynamic layout and have each item be clickable. I've found some example code online but half of them don't compile for whatever reason and there doesn't seem to be any quick any easy way to parse XML in Objective C. If anyone can point me in the right direction it'd be much appreciated. As a rundown of what I'm trying to do:
  • Ingest and parse an external web-based XML feed containing arbitrary data
  • Iterate through the results and print clickable text and images to a view
  • Onclick for each item call a function passing values on to a new page in the app (I've already got the function it would call written)
Once again thanks in advance for any advice. I didn't expect such a simple thing to stump me as much as it has but then again nothing I've encountered involving iOS development has been easy. :v:

I use (and recommend) ASIHTTP for grabbing web stuff, and hpple for parsing (because you get XPath). But Google's objective-c XML parser is also great.

For your requirements it sounds like a Table View is a natural fit.

Also Ray has a tutorial related to your situation.

OHIO
Aug 15, 2005

touchin' algebra

trigger9631 posted:

I'm working on a research project for work about mobile apps and would like to interview some developers about marketing/promotional strategies for apps. It would be a quick interview, just five questions or so, and I could do it over phone or email.

I could even just post the questions in the thread; would people answer them if I did? I don't want to interfere with the flow of this thread and clog it up with my project.

Let me know if you're interested via a reply, a PM, or an email to jpeters@waggeneredstrom.com. Thanks for your help, appreciate it!

Full disclosure: I work for a PR agency, but I won't be soliciting our services at all. This project is strictly research-based.

It's simple, just get featured by Apple.

OHIO
Aug 15, 2005

touchin' algebra

xelfer posted:

I thought this thread might find this link useful: http://mattgemmell.com/2011/07/25/network-link-conditioner-in-lion

That looks incredibly useful, thanks for the heads up!

OHIO
Aug 15, 2005

touchin' algebra

pokeyman posted:

I can't figure this thing out about a table view cell's editing accessory view. I've made a little project to show off the issue I'm having. If you have a minute, could you run it in the simulator for me? Selecting a cell toggles its editing state if you want to play with it.

In words, the problem I'm having is some weird animation in a UITableViewCell's editingAccessoryView on the first time the cell enters editing mode. I've found a workaround but I'd like to understand what's going on.

If you run the app in the project, you'll see a table view. Edit it. Each cell has a round rect push button for an editingAccessoryView, which should slide in when entering edit mode. Watch the animation closely! The first time you hit the edit button, the rows without the workaround have the button's title slide in from the top, while the rows with the workaround slide in as expected. And it's only the first time entering edit mode; each subsequent time, you see the normal animation.

Can anyone see why this is happening?

That's weird. I messed around with your sample code, and although I couldn't come up with why, I can reproduce the effect with this code. (just used in a View template project)

code:
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
button.frame = CGRectMake(150, 100, 62, 32);
[button setTitle:@"Supden" forState:UIControlStateNormal];

CGRect og_frame = button.titleLabel.frame;

button.titleLabel.frame = CGRectZero;

[self.view addSubview:button];

[UIView animateWithDuration:0.3 delay:0.0 options:UIViewAnimationCurveEaseIn animations:^(void){
    button.frame = CGRectOffset(button.frame, -50, 0);
    button.titleLabel.frame = og_frame;
} completion:^(BOOL finished) {

}];
So in your sample code I can revert your fix by going like:
code:
- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    for (NSUInteger i = 0; i < 6; i++) {
        NSIndexPath *indexPath = [NSIndexPath indexPathForRow:i inSection:0];
        UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
        
        [cell setEditing:YES animated:NO];
        [cell setEditing:NO animated:NO];
        
        if(i % 2 == 0) {
            UIButton *button = (UIButton*)cell.editingAccessoryView;
            button.titleLabel.frame = CGRectZero;
        }
    }
}
I don't know if that's helpful. Something about the button title's frame not being created at first?

OHIO
Aug 15, 2005

touchin' algebra

Akuma posted:

Application failed codesign verification. The signature was invalid or it was not signed with an Apple submission certificate.

The last thing I check if this fails is my scheme. Are you 'Archiving' it? Edit your scheme and see what the build configuration is under the 'Archive' section on the left.

OHIO
Aug 15, 2005

touchin' algebra

Sinestro posted:

Why is my loving UITableView being retarded and not displaying the data? I have implemented UITableViewDataSource on my controller, so what the gently caress?

ForumListViewController.m
ForumListViewController.h

How are you initializing your ForumListViewController? Maybe you accidentally called the wrong initializer. Are you sure your 'forums' array is being populated?

OHIO
Aug 15, 2005

touchin' algebra

Funso Banjo posted:

Apple are driving me crazy.

I created an app, and they rejected it. I fixed the issue, and re-uploaded it. They rejected it again, and gave some very vague reasons. Upon me replying they said "We need to phone you about this issue, give us your number" And a week later they still haven't phoned.

I am tearing my hair out. I have had an app rejected before, again with vague reasons. I fixed it and that one was accepted upon re-submission. In essence, the resolution centre is absolutely terrible. They have simply ignored roughly half of any messages I send through the resolution centre, and when they do reply, it's never particularly helpful.

Is there a trick to getting these people to take you seriously?

What does your app do?

OHIO
Aug 15, 2005

touchin' algebra

CAT ON THE COUCH!! posted:

Let me clarify the problem:

code:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Contact: [email]omgchead@gmail.com[/email]</title>
  <updated>2011-09-21T01:37:25.874Z</updated>
  <content type="application/vnd.ctct+xml">
    <Contact xmlns="http://ws.constantcontact.com/ns/1.0/" 
     id="http://api.constantcontact.com/ws/customers/cheadd/contacts/2">
      <Status>Active</Status>
    </Contact>
  </content>
</entry>
NSLog(@"%d", [[subscriberDetailsXML elementsForName:@"updated"] count]);
Outputs: 1

NSLog(@"%d", [[subscriberDetailsXML elementsForName:@"content"] count]);
Outputs: 0

NSLog(@"%d", [[subscriberDetailsXML elementsForName:@"Contact"] count]);
Outputs: 0

NSLog(@"%d", [[subscriberDetailsXML elementsForLocalName:@"Contact"
URI:@"http://ws.constantcontact.com/ns/1.0/"] count]);
Outputs: 0

What's "subscriberDetailsXML"?

Also I can't speak for the other people, but if you make a simple project that just consists of the issue it's easier for me to poke around at it. Otherwise I gotta do that myself and :effort:

OHIO
Aug 15, 2005

touchin' algebra

zorm posted:

They should really be doing the same thing that they did with Siri though, and buy out the app/company that produced it so that the original developers get their fair share.

I also view it as "intensely lame" because Apple is essentially outsourcing all of the risk & development time to app developers without paying them. Then if said app developers make something that is successful or a good idea they poach the idea and leave the developers with nothing.

Look at Microsoft, the courts and developers have tied their hands over time. They have a hard time adding basic things to their core OS now without huge problems. I agree that this makes for a bad user experience but as a developer it is a huge win.

If you look at what Apple has been adding, the only things that are really safe for app developers to develop for iOS are games and apps in extremely vertical markets.

And education apps. They're not making their own, and are in fact heavily promoting 3rd party education apps to schools!

OHIO
Aug 15, 2005

touchin' algebra

lord funk posted:

I got tired of not having a good image of accelerometer / gyroscope motions for the iPad, so I made my own. Figured I'd share if anyone else wanted it for a manual or something:


Illustrator file and PDF:
https://rapidshare.com/files/2834131909/ipad-device-motion-vector.zip

Awesome, thanks!

OHIO
Aug 15, 2005

touchin' algebra

stray posted:

My question is: Why do I necessarily care about retaining str if I'm simply passing it in as a parameter? If we use the setPosessionName: method, which sets posessionName equal to str, then why would posessionName lose its value if str was released after setPosessionName: was called?

Because 'str' and 'possessionName' are pointers! (see the * in NSString *) They're not basic data types like 'int'.

possessionName won't lose its value, that is, the memory location of where it's pointing. But the memory at that location becomes worthless when 'str' releases it (if that is the final release that causes a dealloc on that NSString *)

OHIO
Aug 15, 2005

touchin' algebra

lord funk posted:

Where do you begin when EXC_BAD_ACCESS just points to your main() instead of a specific variable or function? There are 10 million things that could be happening here, but there has to be a way to see what's really causing this. :(

Have you tried Zombie mode with the profiler in the simulator? That might give you some helpful info.

OHIO
Aug 15, 2005

touchin' algebra
code:
[scrollView initWithFrame:CGRectMake(0, 120, self.view.frame.size.width, 240)];

You need to allocate memory for your object before you can initialize it, even if it's an instance variable.

So do what you already did in your next example:

code:
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 120, self.view.frame.size.width, 240)];
but without declaring it as a local variable (since you declared it as an instance variable). (also be sure to release it in your -viewDidUnload since you're creating it in -viewDidLoad)

OHIO
Aug 15, 2005

touchin' algebra

lord funk posted:

I'm in the habit of doing something like this:

code:
@synthesize scrollView = _scrollView;
then initializing the instance

code:
UIScrollView *_scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 120, self.view.frame.size.width, 240)];
But does the scrollview really have to be a property in this case? Does it need that accessibility?

Won't the compiler complain about you declaring a local variable when you declared it as an instance variable?

OHIO
Aug 15, 2005

touchin' algebra

BigRedDot posted:

Yup, I got rejected for Austin and worked on an app in the app store as well. Lame.

I got into Seattle! I don't know what their criteria is though. I also went to the one in November 2009 if that matters?

OHIO
Aug 15, 2005

touchin' algebra

Sulk posted:

Can someone explain why linking windows is so unbelievably loving difficult? I'm trying to create a main window for this map application the book wants me to make because I'd rather just learn how to make the window than use their hacked file. I keep getting errors saying that the nib was loaded but no view was set.

http://www.iphonedevsdk.com/forum/iphone-sdk-development/2180-loaded-nib-but-no-view-set-error.html

http://www.makebetterthings.com/iphone/where-is-mainwindow-xib-in-xcode-4-2/

I tried all of the solutions here. I linked the app delegate to the window as its delegate, set the window as the view controller/changed the class as it mentions, and I tried modifying various lines in the actual code. Nothing works. It's late and I'm just going to go to bed, but I'm really loving frustrated with how illogical this poo poo can be sometimes. Maybe MVC is just a really confusing thing that I'm simply not getting, or I'm (once again) doing something horribly stupid, but I'm following the instructions that people said helped resolve their issues and it's just not working.

I don't want to quit on this poo poo, but it's becoming absolutely infuriating at how some of Objective-C/the Framework's design works, and Xcode doesn't seem to do much to help you. It's not helping my case for not trying to work with C# instead. Perhaps I should just try their hack or simply skim over the rest of the map app chapter I'm on and move on until I follow the book's later guides to creating windows and the like. Who knows. (Sorry in advance for the rant. I'm just really frustrated.)

Will you post your "applicationDidFinishLoading" method?

OHIO
Aug 15, 2005

touchin' algebra
Check out https://github.com/davedelong/DDMathParser

It's made by a guy who works at Apple.

OHIO
Aug 15, 2005

touchin' algebra
I think you should not worry about it for now, and instead try and make your code clear and comprehensible and functional. Then later on in the project when you want to increase the performance, run a profiler and optimize the bottlenecks. From my personal experience I regret pre-optimizing, it just hasn't been worth it.

OHIO
Aug 15, 2005

touchin' algebra

Funso Banjo posted:

Anyone have their paydate on Connect yet?

Seems a little late. It's my first big payment, so I am a little nervous. It says how much I can expect, like always. Just no date on there yet. I figure it was a 5 week month last month, perhaps that's why.

Can't help but think it's normally just a few thousand dollars, though, and this time it's a lot more, and maybe they're trying to find a way not to pay me so much. Paranoia, I am sure.

I don't have a date yet either but I'm not worried. Did you get featured? Congrats!

OHIO
Aug 15, 2005

touchin' algebra

Malloreon posted:

Quick question. I'm making a class for a deck of playing cards. This is in the deck init/shuffle method:

code:
NSArray *suits = [NSArray arrayWithObjects:@"C", @"D", @"S", @"H", nil];
NSArray *values = [NSArray arrayWithObjects:@"A", @"2", @"3",@"4",@"5",@"6",@"7",@"8",@"9",@"0",@"J",@"Q",@"K", nil];
    for (NSString *s in suits) {
        for (NSString *v in values) {
            tempCard = [NSString stringWithFormat:@"%@%@", s, v];
            NSLog(@"%@", tempCard);
            [self.deck addObject:tempCard];
        }
    }
the NSLog prints out the tempCard just fine, but for some reason, the next line, [self.deck addObject:tempCard]; doesn't add anything to my NSMutableArray. Any idea what I'm doing wrong?

Did you initialize your deck array?

OHIO
Aug 15, 2005

touchin' algebra
What does your draw call look like? Your first 3 points are a straight line, not a triangle.

Adbot
ADBOT LOVES YOU

OHIO
Aug 15, 2005

touchin' algebra

nolen posted:

code:
glDrawArrays(GL_TRIANGLES, 0, areaTrianglePointCount);

The 'GL_TRIANGLES' is the primitive you're drawing. Here's info on how you're supposed to specify different primitives.

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