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
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Let's talk about writing any code for iOS, macOS, tvOS, and watchOS! And let’s talk about writing Swift for anything!

What this thread is about

Anything to do with coding for anything Apple has ever made. Apple II through iPad Pro. HyperCard through Swift. Hiring developers (bring money). Any App Store. Safari. Books. AppleScript.

There are people in this thread who have been doing Apple-y development for literally decades, people who are currently working at Apple developing cool stuff, and people who are just getting started. Everyone’s welcome!

Get started

If you’re making something for any Apple platform, your first step is probably to install Xcode on your Mac. It’s free and you can find it in the Mac App Store. You’ll use Xcode to develop iOS, Mac, Apple TV, and Apple Watch apps. If you don’t have a Mac, you’ll need to get one; it won’t necessarily need to be brand new, but a ten-year-old MacBook Air isn’t gonna lead to funtimes either. Ask the thread if you’d like recommendations to fit your budget!

If you want to try out Swift on your iPad, get the Swift Playgrounds app from the App Store. It’s free and provides a full-blown Swift compiler and a handy environment for writing Swift, plus numerous tutorials and other activities. You can also try Swift on your Linux machine? That’s a thing!

Installing your iOS/TV/watch apps to your own iOS/TV/watch devices is free, but distributing to others requires an annual Apple Developer membership. Running your Mac apps and/or sending them to others is free; distributing via the Mac App Store requires an annual Apple Developer membership.

There are many tutorials online about getting into iOS dev. There are books. There are university courses. Feel free to ask in the thread if you’d like suggestions.

Getting into Mac dev? There’s some still-good resources in the “archive” Apple Developer site. Don’t be scared of the warnings about being out-of-date; the Mac doesn’t change that much and it doesn’t change that often. Especially the more introductory or conceptual bits will serve you well for a brand-new app you’re starting today; you can always read the release notes to get up to speed once you get your footing.

Handy development bits

Your package management options are Carthage, CocoaPods, Swift Package Manager (Linux and Mac only, as I write this in January 2019), or manually copying files and dragging them into your Xcode project. That said, Apple platforms ship with a rich collection of mature frameworks with a ton of functionality, so you may find that you need few or no external libraries to build even the most complex app. Whereas in JavaScript-land your first instinct may be to search npm for a library, in Apple-land your first search query should go to the platform documentation.

Worth watching

Apple Developer videos, including sessions from Apple’s annual developer conference called WWDC (don't forget prior years!).

pokeyman fucked around with this message at 02:36 on Jan 9, 2019

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Relevant SA Threads

Threads with nearby topics:

Goon projects doing Apple-y development:

Moribund technically-adjacent threads:

This thread's predecessors:

pokeyman fucked around with this message at 02:11 on Jan 9, 2019

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Collected thread wisdom

Provisioning profiles explained!

You've set an exception breakpoint but want the message too? Set the breakpoint action to po $eax. cite

pokeyman fucked around with this message at 13:46 on Mar 15, 2013

Small White Dragon
Nov 23, 2007

No relation.
Question posed from an earlier thread: I have a large UIButton and, due to its size, the "highlight" glow doesn't show up. What can I do about this (aside from shrinking the button)?

Also, I just added an GLES2 pipeline, and I have the problem that sometimes it will run at full 60fps, and other times at will run at a fraction thereof. Anyone ever seen any like that?

code:
	struct TileStruct {
		GLshort vX;
		GLshort vY;
		GLshort vZ;
		GLshort tX;
		GLshort tY;
		GLshort tZ;
	};

...

        // Use the program object
        glUseProgram(_shader.programObject);
        
        // Load the vertex position
        glVertexAttribPointer(_shader.positionLoc, 3, GL_SHORT, GL_FALSE, sizeof(struct TileStruct), &coordinates[0].vX);
        glVertexAttribPointer(_shader.texCoordLoc, 3, GL_SHORT, GL_FALSE, sizeof(struct TileStruct), &coordinates[0].tX);
        
        glEnableVertexAttribArray(_shader.positionLoc);
        glEnableVertexAttribArray(_shader.texCoordLoc);
        
        // Bind the texture and set the sampler texture unit
        glActiveTexture ( GL_TEXTURE0 );
        glBindTexture ( GL_TEXTURE_2D, textures[0] ); //  userData->textureId );
        
        glActiveTexture ( GL_TEXTURE1 );
        glBindTexture ( GL_TEXTURE_2D, textures[1] ); //  userData->textureId );

        // Set the sampler texture unit to 0
        glUniform1i(_shader.tileTextureLoc, 0);
        glUniform1i(_shader.paletteTextureLoc, 1);
        glUniform2f(_shader.texSizeLoc, texSize[0].size.width, texSize[0].size.height);
        glUniform3f(_shader.colorAdjustmentLoc, _colorAdditions[0], _colorAdditions[1], _colorAdditions[2]);
        glUniform1f(_shader.alphaMultiplerLoc, color[3]);
        
        // Draw!
        glDrawElements(GL_TRIANGLES, 6*quads, GL_UNSIGNED_SHORT, indices);
It's never exhibited this in GLES1. :psyduck:

Yakattak
Dec 17, 2009

I am Grumpypuss
>:3

Glad these are all in one now! When you post the issue you're having, at least try to differentiate between cocoa and cocoa touch.

multigl
Nov 22, 2005

"Who's cool and has two thumbs? This guy!"
learn how to use blocks and impress your friends and have women fall over themselves getting to you:

Introduction to Blocks and Grand Central Dispatch

Concurrency the Pro Way

Anode
Dec 24, 2005

Nail me to my car and I'll tell you who you are
For the related threads: The iOS Games Megathread: Lattes of Fun

Yakattak
Dec 17, 2009

I am Grumpypuss
>:3

WWDC 2011 has been announced!

http://developer.apple.com/wwdc/about/

Fake edit: Anyone know what the Student Scholarship contains?

Dr. Glasscock
Apr 15, 2004

HOO-DAH!!! Fatal Wiimote blow to the face, 20 points!
How fast did the tickets go last year? Wasn't it a week or something? I'm trying to get my employer to send me this year. Never been, would be awesome.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Small White Dragon: What are you using to do your refreshes? If it is anything other than CADisplayLink then that can be a problem. Otherwise I'd use the new Instruments to check on your OpenGL pipeline and see why it is freaking out. It has some nifty new abilities to suggest best-practices or highlight issues that are performance problems.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Dr. Glasscock posted:

How fast did the tickets go last year? Wasn't it a week or something? I'm trying to get my employer to send me this year. Never been, would be awesome.

Yeah, somewhere between 8 and 12 days, if my poor memory serves me. Hopefully I will be going as well.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

multigl posted:

learn how to use blocks and impress your friends and have women fall over themselves getting to you

That's not even hyperbole. Thanks!

Anode posted:

For the related threads

And thanks to you!

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

Small White Dragon posted:

Also, I just added an GLES2 pipeline, and I have the problem that sometimes it will run at full 60fps, and other times at will run at a fraction thereof. Anyone ever seen any like that?
Do you mean it slows down during different execution sessions, intermittently during a session, for short sustained periods or throughout an entire execution? Is your device performing any other activity during these slowdowns? Are you changing textures or mesh sizes?

Have you got a frame interval counter in your render loop to measure how long each slower running frame takes? Are they at even divisions of 60Hz? Does the problem exhibit itself when you target a 30fps frame rate?

As Ender.uNF suggests, have you tried profiling your app with Instruments and checked for memory leaks?

Is this running on OS X, iOS emulator or a real iOS device (if so, what generation)?

Without some real data we can only randomly guess at what may be causing your problem.

Anode
Dec 24, 2005

Nail me to my car and I'll tell you who you are
Anyone have a recommendation for a decent, affordable place for App Store localisation?

wolffenstein
Aug 2, 2002
 
Pork Pro
And it's sold out.

TOMSOVERBAGHDAD
Dec 26, 2004

Switzerland is small and neutral!

Yakattak posted:

WWDC 2011 has been announced!

http://developer.apple.com/wwdc/about/

Fake edit: Anyone know what the Student Scholarship contains?

The student scholarship is traditionally just a conference ticket; I doubt they'd change it to include anything extra.

Yakattak
Dec 17, 2009

I am Grumpypuss
>:3

TOMSOVERBAGHDAD posted:

The student scholarship is traditionally just a conference ticket; I doubt they'd change it to include anything extra.

I meant the application process, sorry.

Dr. Glasscock
Apr 15, 2004

HOO-DAH!!! Fatal Wiimote blow to the face, 20 points!

wolffenstein posted:

And it's sold out.

drat, turns out my employer was definitely gonna send me. Nobody thought it would sell out in 6 - 12 hours. I figured it would be a day at least. :(. Next year I guess.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Dr. Glasscock posted:

drat, turns out my employer was definitely gonna send me. Nobody thought it would sell out in 6 - 12 hours. I figured it would be a day at least. :(. Next year I guess.

Same boat. Got approval to go lat night, went to reg. this AM, and :cry:

Small White Dragon
Nov 23, 2007

No relation.
Selling out this fast is insanity. :psyduck: I can only assume it will get worse.

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

Small White Dragon posted:

Selling out this fast is insanity. :psyduck: I can only assume it will get worse.

That is an excellent assumption, unless Apple expands capacity. Unfortunately that can have the effect of reducing the effectiveness... I've heard that the best part about going is being able to talk to Apple folks one on one. If it gets too big that will be less likely.

Watching the WWDC videos, most of them are fairly basic stuff so I wonder how much there is to get out of the sessions.

LP0 ON FIRE
Jan 25, 2006

beep boop
I've been asked to check out different game engines out there that would make porting to different platforms not such a hard task. We'd be starting out making something for iOS. Any suggestions for either 2D or 3D? So far I've looked at Big World Technology, Panda 3D, and Esenthel.

wdarkk
Oct 26, 2007

Friends: Protected
World: Saved
Crablettes: Eaten
Unity seems popular.

LP0 ON FIRE
Jan 25, 2006

beep boop

wdarkk posted:

Unity seems popular.

Thanks that definitely looks dependable. Can't really use Unity Pro and for iOS unless we pay the $3,000 fee right? Unity free I don't even believe you're allowed to publish anything to the app store.

some kinda jackal
Feb 25, 2003

 
 
"The current quarter of CS193p (Spring 2011) is not on iTunesU and can only be taken by registered students of Stanford University."

gently caress. Although the last time they did this was when they revamped the curriculum, so maybe they're including Xcode4 this time around. I'm fully expecting the next quarter CS193p to be on iTunes U. Meanwhile, the Winter 2010 course is still really really good.

Anode
Dec 24, 2005

Nail me to my car and I'll tell you who you are
Is there a good reason to do more than one quarter? (Honest question, not sarcasm!)

klem_johansen
Jul 11, 2002

[be my e-friend]
Woot! The NYT just named Nash Smasher as one of the top 10 iPad apps for kids!

some kinda jackal
Feb 25, 2003

 
 

Anode posted:

Is there a good reason to do more than one quarter? (Honest question, not sarcasm!)

Well before when it was just iPhone development, probably not. But they've since updated the curriculum a few times, once to generalize on iOS+iPad rather than iPhone, and now I assume to add Xcode4.

If you already know your stuff, absolutely not. Not unless you want a refresher. If you're just starting out or don't know Cocoa/ObjC very well? Probably can't hurt.

Like I was pretty decent at it until I put it all on the backburner to work on my CCNA. I went through the iOS one and it really helped me re-learn some fundamentals. I guess you could argue that if I forgot them that quickly then I wasn't really that good to begin with, so whatever :3:

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Ender.uNF posted:

That is an excellent assumption, unless Apple expands capacity. Unfortunately that can have the effect of reducing the effectiveness... I've heard that the best part about going is being able to talk to Apple folks one on one. If it gets too big that will be less likely.

Watching the WWDC videos, most of them are fairly basic stuff so I wonder how much there is to get out of the sessions.

They could do more of them, instead of making it bigger. Although that's not really scaleable either.

smug forum asshole
Jan 15, 2005
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:

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.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

OHIO posted:

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.

For example, what I just did before I read OHIO's response: switch to Xcode, hit command-option-shift-/ and typed 'applicationdidfinish', hit the first result, and read: "This method is used in earlier versions of iOS to initialize the application and prepare it to run. In iOS 3.0 and later, you should use the application:didFinishLaunchingWithOptions: instead." (And 'application:didFinishLaunchingWithOptions:' was a link.)

lord funk
Feb 16, 2004

Is there a jump to the next / previous #pragma mark keystroke?

Dr. Glasscock
Apr 15, 2004

HOO-DAH!!! Fatal Wiimote blow to the face, 20 points!
Man is anyone able to download and open the XCode 3.2.6 DMG from the developer site? I tried it and had 2 others try it and send it to me, every time I get an invalid checksum.

I couldn't stand XCode 4 being leaky as poo poo anymore so I went to roll back. Now I have a dev machine without XCode on it. Yay for wasted time.

EDIT: Man I've spent the entire loving day trying to get A copy of XCode downloaded (3 or 4, whatever). I have 4 other guys in the office all trying to grab a working file from different networks. Some guy on the apple forums says he got a working 3.2.6 and posted the SHA hash, but he has to be full of poo poo. No matter what the file gives an invalid checksum every loving time. The file has to be corrupt.

Now we're just trying to get a copy of 4 downloaded but it keeps stalling and timing out. Or the file is too small. This is getting ridiculous.

Dr. Glasscock fucked around with this message at 18:33 on Mar 31, 2011

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

Simulated fucked around with this message at 18:58 on Apr 1, 2011

aehiilrs
Apr 1, 2007
What is the current wait time for a corporate developer program enrolment? My boss applied near the beginning of February and there's still no word on it.

Is there a chance this is hung up with someone further up the management chain in my company who they have called to verify stuff with?

dizzywhip
Dec 23, 2005

So I'm trying to do some basic audio programming in Cocoa (OS X, not iOS) and I'm having a lot of trouble. I'm totally new to audio programming, so it'd be nice to have a nice, simple walkthrough on how to do some basic tasks, but Apple's audio documentation is pretty awful.

Specifically, I want to generate some MIDI data and play it back with standard MIDI instruments. The only concrete example I can find that does what I want is this. That works fine I guess, but it doesn't really explain what it's doing for the most part. I can follow by example well enough, but I feel like I don't really understand half of it.

I'm also not really happy with this code in that the MIDI events need to be generated in real time. I was hoping to generate a bunch of midi data beforehand and then pass that off somewhere to play.

I'm sure I would have found something on Google if it was out there, but if anyone knows of any resources that focus on getting started with this stuff from a total beginner's perspective that would be awesome. Or if there's some kind of higher-level audio framework I could use that would be great too. Everything I found seemed to be really out of date though.

Dr. Glasscock
Apr 15, 2004

HOO-DAH!!! Fatal Wiimote blow to the face, 20 points!
Over 6 hours into the day and I still can't get any loving version of XCode downloaded, this is ridiculous. Time for a support request I guess.

Anode
Dec 24, 2005

Nail me to my car and I'll tell you who you are

Gordon Cole posted:

Apple's audio documentation is pretty awful.

Apple's everyone's. I'm pretty much in the same position as you, but from I hear, OSC is a lot easier to work with than MIDI.

Adbot
ADBOT LOVES YOU

some kinda jackal
Feb 25, 2003

 
 

aehiilrs posted:

What is the current wait time for a corporate developer program enrolment? My boss applied near the beginning of February and there's still no word on it.

Is there a chance this is hung up with someone further up the management chain in my company who they have called to verify stuff with?

By all means have him call Apple. Mine was hung up because apparently they don't accept a legally registered Ontario "sole proprietorship" as a business entity, but didn't actually tell me and I had to finally just call some number I found on the developer site and got the straight dope. If you are a verifiable contact point for your company they should at least be able to tell you what is being held up.

Wish they had made the "sole proprietorship isn't valid for a corporate enrollment" thing clearer before I blew like a hundred bucks registering everything with the loving province though.

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