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
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!

Fists Up posted:

Or whether I should start right at the beginning with something like the dummies books or something else entirely and then work onto an iphone specific book.

Don't get a Dummies or Sams book because they are always horrible. Barnes and Noble has that 50% off coupon on Slickdeals so go there and see what books you like.

geera posted:

I've gone about halfway through the Big Nerd Ranch guide and it's really good. Very thorough and they cover pretty much everything you'll want to know. They assume you know C in the pre-reqs, but I haven't seen anything that would trip you up if you don't.

I have the Deitel "iPhone for Programmers" and the WROX "Beginning iOS4 Application Development", but I haven't really gotten past the 3rd chapter or so yet. I also have the APress 'Beginning iPhone Game Programming' and 'Cocoa on the Mac', but haven't really gotten into those either.

The Big Nerd Ranch books don't click with me for some reason. They like to randomly scatter code around the chapter and it's hard for me to put it all together. The writing and teaching style are good though.

Adbot
ADBOT LOVES YOU

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!

3/4GB and a $99 SSD should make it alright.

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!

Is there any reason not to do stuff like puzzle games in just plain UIKit?

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!

monkey posted:

I'm working on my first iPhone game and have come up against a bit of a showstopper. I need a scrabble dictionary in memory to do some very fast spellchecking, hopefully checking about 100 words vs 250,000+ words in a single frame.

Stackoverflow gives a suggestion of using a form of compression (since you've only got 26 letters, no need to use a byte for each character) and cramming each of the 250k words in to a 64-bit value, ending up at 2mb.

http://stackoverflow.com/questions/2276641/way-to-store-a-large-dictionary-with-low-memory-footprint-fast-lookups-on-andr

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!

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?
code:
UIImageView *gameGrid[10][10];
vs
code:
struct
{
int solid, int color;
} block;

block *gameGrid[10][10];
(ignore the probably incorrect C syntax)

If I used the second way, would I just use a method like drawAtPoint to draw the bitmap for the block for each cell in the gameGrid? Let's say I'd have < 20 images total, some for different colors of blocks and then maybe 'jewels' or another piece of each color.

Would I just keep the UIImageViews off screen or hidden, or what in that case?

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!



^^ What's that toolbar or whatever called with the arrows on it? I don't see it in my books, I want it.

Edit: gently caress nevermind, it's just a black toolbar.

Bob Morales fucked around with this message at 03:20 on Apr 19, 2011

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!

Is there a quick blog post or guide to setting up your own buttons for a simple game? I just want 'right', 'left', 'rotate', and 'drop'.

I'm under the assumption that I can't (or shouldn't) use UIKit because I made my own view and I'm just drawing crap to that with Quartz2D, mostly just using my awesome sprite function hooked up to a timer:

code:
-(void) drawSprite:(int) spriteImage x:(int) x y:(int) y {
	CGContextRef context = UIGraphicsGetCurrentContext();
	CGContextSaveGState(context);
	
	[bug[spriteImage] drawInRect:CGRectMake(x, y, BZ_SPRITE_WIDTH, BZ_SPRITE_HEIGHT)];
	
	CGContextRestoreGState(context);
}
I was thinking I would just make 4 images (well maybe 8, one to use while the button is 'down') for each button and draw them every frame. Then just handle the touch events for my view, figure out which button is touched and do whatever from there. Would it be best to write some sort of function that returns a button ID instead of putting the same screen location detection in each function?

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!

modig posted:

This is probably useless to you, but why are you using that rather than just using CoreAnimation and UIImageView?

I don't really know.

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!

My Dr. Mario clone is up and running in the simulator.



I just got touch/buttons working, next up is respawning the pieces and doing the matching/elimination of pieces. I wrote this game last year using OpenGL/SDL so I've basically just been copying and pasting some badly written C code into a UIView subclass. Oh, and I used Quartz2D instead of OpenGL ES (Why? Hell if I know).

I'm going to bug an iPhone guy at work tomorrow and see if he can load it on an actual device so I can jerk off to it. This is pretty much the only iOS or MacOS thing I've done so far, unless you count examples from books.

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'm trying to draw graphics in a function other than drawRect
code:
@implementation SpriteTest

-(id)initWithCoder: (NSCoder *) coder {    
    if (self = [super initWithCoder: coder]) {
		[self gameLoop];
	}
	
	return self;
}

-(void)gameLoop {
	game.score = 0;
	
	[self loadGraphics];
	[self setupGraphics];
	
	[self initializeTimer];
}


- (void) animateGame:(NSTimer *)theTimer {
	[self setNeedsDisplay];
	[self processInput];
	[self gameLogic];
}


- (void)drawRect:(CGRect)rect {
	[self drawPlayingField];
	[self drawCharacter];
}

-(void) drawControls {
	int bOffset = SCREEN_VRES-BUTTON_HEIGHT;
	[gameButton[0] drawInRect:CGRectMake(BUTTON_WIDTH*0, bOffset, BUTTON_WIDTH, BUTTON_HEIGHT)];
	[gameButton[1] drawInRect:CGRectMake(BUTTON_WIDTH*1, bOffset, BUTTON_WIDTH, BUTTON_HEIGHT)];
	[gameButton[2] drawInRect:CGRectMake(BUTTON_WIDTH*3, bOffset, BUTTON_WIDTH, BUTTON_HEIGHT)];
	[gameButton[3] drawInRect:CGRectMake(BUTTON_WIDTH*4, bOffset, BUTTON_WIDTH, BUTTON_HEIGHT)];
}
The drawControls stuff works, how would I make the drawPlayingfield work in another function? It either doesn't draw or I get an error. I've tried [self drawPlayingField], but I'm thinking I'm just calling it in the wrong way.

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!

Gordon Cole posted:

drawPlayingField isn't in the code you posted, so we can't see what it's doing.

It's basically this:
code:
[gameTile[0] drawInRect:CGRectMake(TILE_WIDTH*0, tileOffset, TILE_WIDTH, TILE_HEIGHT)];
Basically a loop that draws a bunch of background tiles.

I also have something like 'drawItems' that draws the game objects. Those are all UIImages, just like the gameButtons. When I refer to something like: [this drawWhatever] does it not work because 'this' has to be a function with a CGrect passed to it or something?

What I'm trying to accomplish is I have my game (say Tetris) running and it works okay. But when you complete a line, I want to do an animation where the rest of the pieces 'drop down', so what I did is put something in the method that 'drops' the pieces after you've completed a line(s) that moves the objects down, redraws, pauses, then moves them down another row, redraws, pauses, etc until the pieces 'land'. But no re-draw occurs.It just pauses x times and then the pieces are magically moved all the way down when that loop ends, and the 'animateGame' starts back up.

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!

Ender.uNF posted:

You can't do it that way. When you draw outside the context of the normal draw loop, it won't get displayed. That's the reason for calling setNeedsDisplay - to let iOS know that it needs to update part of the screen (it caches the render results to improve performance and make some of the CoreAnimation effects work).

Typically in a game you separate out the concerns of drawing vs game state. For example, just do the calculation to see how many lines need to go away then kick off an animation that will remove the lines and let the logic code path continue. In your drawing code, after every x amount of time you can remove another line and move things down, adjusting the animation object as you go. When the animation is finished the draw code can remove it from the queue.

This is just one approach... There are many other possibilities. If you stay with your current design the performance will be limited but it might not matter for a tetris game, in which case using setNeedsDisplay (after every visible change) might suffice.

I realize that, but I thought I put [self setNeedsDisplay] in that other loop and it either didn't re-draw, or crashed. The code is at home or I'd check for sure.

I guess I might as well link that animation to the main timer, since as the game goes faster I'm going to want the leftover pieces to drop faster as well.

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!

Ender.uNF posted:

Hmm.. if you are calling setNeedsDisplay at the end of your main timer it shouldn't cause a crash but there are plenty of ways to shoot yourself in the foot. Do you remember what the crash was?

If I put [self setNeedsDisplay] in the loop (not the game loop but the 'drop loose pieces loop', it never updates the screen.

If I put [self drawPlayingField] it writes this to the console:


Tue May 17 21:57:19 Rocket.local SpriteTest[431] <Error>: CGContextSaveGState: invalid context 0x0
Tue May 17 21:57:19 Rocket.local SpriteTest[431] <Error>: CGContextSaveGState: invalid context 0x0
Tue May 17 21:57:19 Rocket.local SpriteTest[431] <Error>: CGContextSetBlendMode: invalid context 0x0
Tue May 17 21:57:19 Rocket.local SpriteTest[431] <Error>: CGContextSetAlpha: invalid context 0x0
Tue May 17 21:57:19 Rocket.local SpriteTest[431] <Error>: CGContextTranslateCTM: invalid context 0x0

code:
-(void) drawSprite:(int) spriteImage
				 x:(int) x
				 y:(int) y {

	CGContextRef context = UIGraphicsGetCurrentContext();
	CGContextSaveGState(context);
	
	[tile[spriteImage] drawInRect:CGRectMake(x, y, SPRITE_WIDTH, SPRITE_HEIGHT)];
	
	CGContextRestoreGState(context);
}
So basically I'm not getting the context because it's not available where I'm calling it from.

drawPlayingField is basically a loop that calls drawSprite a bunch of times. It's like if I call drawSprite from anywhere except a function that I call from drawRect, it has those context errors. Could I store the context in a global variable or is it guaranteed not to stay the same or something?

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!

Ender.uNF posted:

You can create your own bitmap context (matching your view's dimensions and scale) and draw to that, then in drawRect blit that to the screen (which is just another form of deferred rendering). Apple's stated requirements are to update your state, set needs display, then defer the actual drawing to drawRect.

I'll just make an off-screen buffer and draw to that.

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!

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. But what happens to me is that since I'm not touching an actual button, my thumb will wander from say 'left' to 'right' or from 'jump' to 'shoot'. Or off the touch screen area entirely. Very frustrating.

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?

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!

Yodzilla posted:

So I'm trying to implement push notifications using Urban Airship in an app and I'm absolutely confounded by these errors. I had this poo poo working last night and it compiles if my target is iOS Device but if I try to compile it to run in a simulator I get over a hundred Apple Mach-O Linke Errors like this:


And I just don't get it. I've included all of the frameworks that the UA sample app was using and I can't find any documentation on what those errors even mean.

e: it's doubly confusing because it refuses to compile and run in the simulator but i can install it to my iPad and it works just fine. i really don't get it

It looks like the library doesn't even contain code for the simulator (i386).

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!

Yodzilla posted:

Which is weird because they explicitly say on their site that they new 1.0.5 version does contain the library. And whatever version of Urban Airship that Appcelerator uses works just fine in the simulator so I really don't know.

Check this page out:

http://support.urbanairship.com/customer/portal/questions/3170-push-api-libuairship-1-4-a-missing-required-architecture-i386

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!

How would you accomplish a custom view (or whatever it would be called) like the 'downloads' window in Firefox?



Do you have to create a view that procedurally adds all the items like the icon and text labels, or is there an easier way? Are they all held in some sort of existing class?

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!

Sulk posted:

Also, what is a good book to pick up for iOS development itself? There's one I saw by the same publisher which has a new edition coming out next month, but if anyone has any suggestions it'd be appreciated.

Most of the beginning books are basically "Here's how you make a button", "Here's how you make a browser window", "Here's how you tell if the device is being tilted". And nothing to tie it all together or actually create anything useful.

The Big Nerd Ranch book is a good one to start with, they at least ask you questions about what you just learned and prod you a little to investigate stuff in your own.

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!

dereekb posted:

Great, just what I was looking for! Thanks for the help.

Just as an misc. question: Are MacBook Airs decent to program on, or would a Mini/MBPro be a better choice?

Do you need a portable? Hard to beat the combination of an i5, cheap RAM upgrades, SSD+HD, and built in high-res screen you get with an iMac.

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 was going to use the 50% Barnes and Noble coupon from Facebook to buy a book tonight. Is the "Learning Cocos2D" book any good, or is it as out of date as the Amazon reviews saw? I'm hoping there's a newer version of the book in the stores.

http://www.amazon.com/Learning-Cocos2D-Hands-Building-Chipmunk/dp/0321735625/ref=pd_sim_b_2

I've been poking around with iOS for about a year but I've been doing everything 'the hard way', without a game library and just using OpenGL.

The other 2 books on cocos2D have even worse reviews so if there isn't a good one, I'll just buy something else.

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!

Doc Block posted:

There's one that seemed decent enough after a quick glance, and it covers Cocos2D 1.0, the latest stable version. I'll look up the name once I'm back at my computer.

edit: the one I was talking about is the one you linked to. Granted, I've only glanced at it, but the book claims to cover Cocos2D 1.0, which as I said is the latest stable version, so I don't know how it could be out of date.

I was looking at it today and I didn't get it. The game they make in it is kind of silly and I don't really think the examples are that great. I'll give it another look on Saturday, I'm in no hurry to buy if I don't need to.

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!

xelfer posted:

The new cocos2d book was just released on amazon and apress 2 days ago (http://www.learn-cocos2d.com/) - i've ordered it. I have the first edition, it was OK for learning cocos2d (I haven't been through it all) but I'm hoping the new edition goes a bit further in explaining the basics, as I'm still trying to wrap my head around it. It's written for ios5 and xcode 4 which is the main reason I've ordered it.

Has anyone read both the Itterheim and the Rod Strougo / Wenderlich one and have opinions on what's better?

I forgot I had the previous version of that book, "Learn iPhone and iPad Cocos2D Game Development", it's much better.

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!

How big of a deal is all this ARC stuff in Xcode 4.2?

I'm still on Snow Leopard and I can't build an app using ARC for OS X (but I can for iOS) without switching to Lion, which I really don't want to do.

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!

What's the best way to do non-Tab View tabs?



Those would even be fine. I was thinking of making a row of gradient buttons, then altering their properties (mainly width and if the border is visible) based on which one is 'active'. Like this:



Then when I click on a 'tab', I just make the TextView that it's linked to visible (one tab and one text view for each IRC channel).

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!

Can I move or resize an NSButton while my app is running? I was going to make a tab system and was going to just use NSButtons, but it looks like I'm going to have to make my own.

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!

pokeyman posted:

Yes? Just set its frame.

Derp. That was simple. Didn't see it on the NSButton reference and haven't worked with views enough to realize it would inherit that method.

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!

This might be better suited for the screenshot thread, but I stayed up last night working on something for the first time in a long time.



I wrote my first custom view, tabs! I need to add maximum tab sizes so if you have only 1 or 2 tabs they don't fill the size of the view, but there's a close button and it even highlights when you hover over it.

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!

Olivil posted:

Any of you have experience with this book?
Objective-C Programming: The Big Nerd Ranch Guide

That's a good start. It's a much easier to follow (and swallow) book than most other Objective-C books, and is current so it covers things like ARC.

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!

Has anyone taken a class at Big Nerd Ranch?

Another guy and I at work are tasked with getting up to speed on iPhone stuff, I have some experience but he's starting from scratch (but has done plenty of web programming). The boss would prefer to just send us somewhere for a week, they've used Pragmatic Programmer classes before.

I'm wondering if they just re-hash what's in the books.

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!

SheepThrowinBoy posted:

I've got the basics of Xcode down and I'm even enrolled in the Apple Dev Program. I've made a few piddly Hello World programs, but I feel like I'm building a house without being able to read blueprints. Now that I know I CAN do it, where do I go to understand WHAT I'm doing?

Do you know C and Objective-C yet? That's probably your first step. I know when I read some iPhone/Mac books 2 years ago I would get lost in all the collection classes (NSArray, NSDictionary), memory management stuf, and the fact that I just didn't know how to use any of the tons of methods all the objects have. poo poo I still feel like I haven't scratched the surface of most of the objects. Robert Clair, Steven Kochan, and Aaron Hillegass all have books out about Objective-C 2.0

Once you've gotten a grasp of the base language, just start trying to write some apps. Simple-seeming stuff like an address book with photos will get your feet wet. Apress makes a couple books that are worth looking through, the Big Nerd Ranch stuff is good but it's more theory than application (not that that is a bad thing)

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!

SheepThrowinBoy posted:

Is there any advantage/disadvantage to signing up for a cheap community college course or online program to learn these basics, or is that more of a "depends on how you learn" question? If you have any experience with online learning, any suggestions on which program I should consider? I have access to a lot of C books and ebooks via my brother, so if all else fails I'm just going to pour through a couple of those.

IMO a community college 'programming' course will consist of 12 weeks of writing retarded poo poo in C++ like "Enter the names of some records and print them out alphabetically"

Dink around with Ruby/Python or something for a little bit and jump into C/Objective-C

Maybe one of these two books first, then an iPhone programming book



One problem with C is that there are a lot of lovely C books out there. Another problem with C is that to do anything useful it's very specific on what libraries and tools you use to build it, so a good book is hard to find. Those two books won't teach you anything Mac-specific (well, the Obj-C one will) but they will do everything ON a Mac, which is a big help for a beginner.

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!

When I create a simple Cocoa Application project, Xcode makes an 'AppDelegate.h/.m' and I put all the example code from a book in that code.

I have an older book (Cocoa Programming with Mac OS X, focusing on 10.2?) and in that version of Xcode you must have had to make the delegate classes by hand or something. Anyway, is there a way I can connect outlets to SomeOtherClass.m? Do I have to let my program know I want to access methods in those other classes, so I can get the 'blue cube' for that class to appear so I can connect Outlets to my nib?

I have newer books I just was curious to the answer to this question. I like this book (and am waiting for the new edition to come out), most of the stuff is still useful, it's just the initial setup and wiring up of the apps that gets weird.

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!

Built 4 Cuban Linux posted:

Any recommendations for a next step? I want to buy another book. Online material is fine for supplementation but I like something physical. I was thinking this: http://www.amazon.com/iOS-Developers-Cookbook-Essential-Programmers/dp/0321832078/ref=sr_1_3?ie=UTF8&qid=1330007758&sr=8-3

Anything better?

That's not a terrible book. It's a 'cookbook' so instead of explaining here's how you do this, blah blah, it just shows you with a real example.

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!

Is there any legitimate reason for Apple to charge $99 for EACH developer program (Mac and iOS)? Accounting? Pure evilness?

I know the only thing the $99 really gets me on the Mac side is the Mac App store but c'mon.

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!

Stupid Objective-C question, but I'm having trouble on when to make a new object and stuff like that.

Should I do it for everything I can?

Only one object per .m file, right?

Can I make a C-style struct that contains NSObjects or is that just a bad idea?

If I were to do an object called Albums, I'd put that in Album.m and then do something like:
code:
@interface Album : NSObject {
  NSString *name;
  NSArray *songTitles
  NSNumber *price;
  NSImage *albumArt;
}
Or should these be defined some other way?

All the C++ I did was 'C using iostreams' so I'm never worked a lot with objects.

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!

Froist posted:

Forgive me for what may be an stupid question.

I've got a few years experience writing mobile apps (mainly Symbian) and about 6 months ago I started learning iOS development for work, and have now made a couple of business-y iPad apps. I've had an idea for a game I want to make in my free time, but having never made a game before I'm not really sure how to start.

My idea's for a game similar to Bejewelled (yeah, we need another one of those) so luckily it takes physics engines/complex input/3D rendering out of the equation. I was also going for a very minimal graphic design, similar to Async Corp with (probably) manually drawn objects rather than image textures which would usually be managed by a game engine.

Given these factors, and my inexperience with any game engines, how would you approach developing this? I see I have 3 options:
  • Man up and learn how one of these engines works, probably cocos2d (unless there are any other suggestions?)
  • Create my UI with lots of custom UIViews, one for each 'block' in the puzzle plus others for the other UI elements, and manipulate these as the game is played
  • Create one big custom UIView that does all the drawing for the whole game grid (I think this is a bad option)

Obviously these last 2 options lock me into UIKit and would make porting it to any other platforms far more tricky further down the line. At the moment I don't have any plans for this, but I do have an Android tablet (and know java, though nothing Android specific), so it would be neat if there was an engine I could use with zero modification (aside from the framework requirements) on both that and my iPhone.

Am I an idiot for even considering just using UIViews for this, or is it reasonable given I won't require most of the things I'd expect a game engine provides you with? As it's the method I know off the bat it may be easier for prototyping and just seeing how my idea plays out, and basic UIKit animations should cover the style I'm going for.

You could just have at it with OpenGL.

Or, make your own simple game engine:



Contrary to the title, it's not a 'beginner' book.

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!

:argh: Xcode is such a crash-happy piece of poo poo :argh:

Adbot
ADBOT LOVES YOU

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!

Is there an easy way to enable all the warnings in a '-Wall' kind of way using Xcode 4?

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