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
Doc Block
Apr 15, 2003
Fun Shoe
Or you could get more complicated and implement a formal protocol and have the object generating the coordinates be the view's data source delegate or something.

Adbot
ADBOT LOVES YOU

Physical
Sep 26, 2007

by T. Finninho

Sinestro posted:

Unity is from 400 to 1,900 dollars, but kickass. Although, for most things, it is like bring a minigun to deal with a fly.
Yea I've been using unity and it's nice but I'd still like to toy with the actual engine. Like manipulate vertex meshes and whatever else. So back to my question: does such a thing exist that any of you would recommend? A library that is an objective-c game/render engine?

Related to another conversation: You can run Xcode (and OSX) for that matter in Windows! Using a VM like virtual box or (the more compatible and free) VMWare player. I got my OSX VM to go full widescreen!

haveblue
Aug 15, 2005



Toilet Rascal

Toady posted:

That is the first time I've ever seen Objective-C called a hipster language.

I was programming Macs in the early 00s, I was literally using object-C before it was cool.

Jehde
Apr 21, 2010

Doc Block posted:

If you have an object that's generating coordinates, just have it pass the coordinates to the view. Give the view an NSMutableArray instance variable, and have it loop through that and draw the coordinates.

Something like this:
code:
//Extremely helpful example.
or something like that. Your object can just call [myView addObject:CGPointMake(X, Y)] and call [myView removeAllPoints] if you want to start over.

edit: not to be a jerk, but how/why are you doing this if you don't have Xcode and don't know enough Objective-C to know something basic like what a class method is?

Perfect! This looks like exactly what I need to implement, I didn't know you could actually have methods in the drawing like that. Thank you very much for the detailed explanation.

To answer your question about what the context of this all is, it's for a group term project where the first prototype is due to be working tonight. We need to create an iOS app and as such need to use Obj-C and all that jazz. I'd like to iterate what was said before in that Obj-C is a hipster language, with what little exposure I've had to it so far.

I've been learning Obj-C on the fly and typing out what code I can in NP++ and sending it to another group member with Xcode, and knowledge of how to use it, to compile and test it. This is why I'm focusing on snippets that aren't too dependent on Xcode and leaving the meatier Obj-C parts to the guy with Xcode. Yes this is incredibly tedious and inefficient, but we need to make do with what we have. Thank you again for the help!

Jehde fucked around with this message at 21:53 on Jun 18, 2012

xgalaxy
Jan 27, 2004
i write code

Physical posted:

What iOS 3d game engines/libraries would yous guys recommend?

Do you care what language it's primarily written in?
Usually when someone asks for an 'iOS game engine' they can either mean one of two things. 1. Anything that will run on iOS. or 2. Objective-C specific.

CeciPipePasPipe
Aug 18, 2004
This pipe not pipe!!

Doc Block posted:


And yeah, it seems like a waste of time supporting 4.2. Maybe support 4.3.


I don't understand this, or why the latest xcode bundles a 4.3 simulator. If you're already putting in the effort to support 4.x-era devices, why not go for 4.2? At least the iPhone 3G was EOL'ed at 4.2. Is there any reason for anyone running iOS 4.3 not to upgrade?

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Doc Block posted:

And yeah, it seems like a waste of time supporting 4.2. Maybe support 4.3.

I'm dropping pre-5.0 support in my apps. Over 80% of device owners are on iOS 5, according to Apple. The number of iOS 4 users is dwindling by the day, and trying to keep feature parity across OS versions meant (for me) implementing a lot of stuff myself that iOS 5 has built-in (like UIAlertViews with text entry fields in them).



If you're going to support 4.x, you'd want to be targeting 4.2. 4.3 was when the iPhone 3G stopped getting supported. If you deploy for 4.3 you're just catering to stragglers who haven't upgraded to iOS5 and 3G users are still left out.

If you're fine leaving 3G users out in the cold, just upgrade to iOS5. Better ARC support, storyboards, tons of nice little UI improvements...just go for it and thank yourself later.

Star War Sex Parrot
Oct 2, 2003

Is there likely any significant difference between the normal Command Line Tools and the one for Xcode 4.5 Developer Preview? Both were released on June 11, and I'm just wondering if the compilers will be any different or if it's just path/parameter differences to accommodate the new Xcode. I don't even use Xcode.

Star War Sex Parrot fucked around with this message at 21:46 on Jun 19, 2012

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
If those are the 4.3.3 command-line tools, they are definitely different from the 4.5 tools.

Star War Sex Parrot
Oct 2, 2003

rjmccall posted:

If those are the 4.3.3 command-line tools, they are definitely different from the 4.5 tools.
In what way? Apple doesn't put release notes for their Command Line Tools, which annoys me to no end. I have no idea what LLVM/Clang versions they're using without digging.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
It's covered in the corresponding Xcode release notes. In this case, 4.3.3 is a bug fix release which IIRC does contain a few compiler fixes. It does not support any of the new language features announced for 4.4 / 4.5.

In general, Apple releases of clang do not correspond to any specific open-source revision or release; there's a branch, private changes, and a lot of QA involved.

Froist
Jun 6, 2004

ultramiraculous posted:

If you're fine leaving 3G users out in the cold, just upgrade to iOS5. Better ARC support, storyboards, tons of nice little UI improvements...just go for it and thank yourself later.

I agree with your general point (no reason to support 4.3 if you're cutting off 4.2), but what "better ARC support" does 5.0 bring? I thought ARC was a completely compile-time feature?

On a vaguely related note, does anyone know of a way to test on older iOS versions (through the simulator?) if you've not got a device that's non-upgraded? I'm working on a project at work that needs testing back to iOS 3 but I can't find any way to validate it. My laptop's running Lion with Xcode 4.3.3, so the earliest iOS SDK I can download through Xcode is 4.3.

Today I tried downloading a far earlier version of Xcode (3.2.6 with iOS 3.1?) that Apple were still hosting, but it completely hosed my dev environment. I pointed it to install at the now empty /Developer folder and while it did put some things there, Xcode was nowhere to be found, it removed Git and I could no longer run 'clear' in a console (I found that it had trashed a load of xterm files). I also tried a trick I found of installing just the iOS simulator package from within the DMG and this allowed me to select an earlier SDK through Xcode but crashed on launching the simulator.

Any ideas?

Zhentar
Sep 28, 2003

Brilliant Master Genius
ARC is not just compile time. Notably, the zeroing weak references require runtime support.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
To clarify: on previous OS versions, a weak reference is not automatically set to 'nil' when the object is destroyed, so what would have been no-ops on iOS 5 becomes a message to a zombie object on the older OSes.

I removed support for 4.2 in Storm Sim and immediately had a user email me about it no longer running on their iPhone 3G so there are obviously people still using it. I ended up adding support back for 4.2 to make him happy.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Star War Sex Parrot posted:

In what way? Apple doesn't put release notes for their Command Line Tools, which annoys me to no end. I have no idea what LLVM/Clang versions they're using without digging.

The new XCode 4.4 LLVM is Apple LLVM 4.0. The sessions this year (Which just got posted) on the command line tools, etc were pretty good. The LLVM session was very C++ oriented, so skip that if it's not relevant to you. Objective-C now has new compile time/reverse compatible literals and subscripts that are more exciting than they should be. You have no idea how much I want to write things like @[@1, @2, @3] and array[0].

Edit: Note I'm not disagreeing with you that Apple is irritating on this stuff. Apple at least keeps developing these tools, but they only document their work in the course of one talk a year.

ultramiraculous fucked around with this message at 03:07 on Jun 20, 2012

Star War Sex Parrot
Oct 2, 2003

ultramiraculous posted:

The sessions this year (Which just got posted)
Thanks for posting this. Looks like I've got a lot to watch tonight.

Carthag Tuek
Oct 15, 2005

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



Yesss

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

ultramiraculous posted:

The LLVM session was very C++ oriented, so skip that if it's not relevant to you.

Heh. Two-thirds of that talk was about ARC, general warnings, and static analysis. We can't even squeeze in fifteen minutes of announcing the most complete C++11 implementation on the planet without getting ragged on incessantly. :)

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Is there any way we can get "auto" in Objective-C? I'd rather not convert all my files to mm but I soooo miss "var x = abc;" from C#. It gets so drat tiring repeating the type names twice on several lines in every method.

I can already hear the 410 objection that auto will infer id* in various cases but we already deal with that today by casting and that's exactly how you alter the inferred type in C#: "var x = (MoreDerived)GetFancy();"

I sometimes wish for generics but I guess I'd just have to adopt C++ for my iOS projects but then I have no runtime type information thanks to template instantiation. Honestly... I have no idea how people lived before reflection/introspection. Seems like you might as well write COBOL.

Why can't everything just be perfect and do what I mean?
edit: Also I want ponies and unicorns.

Simulated fucked around with this message at 04:59 on Jun 20, 2012

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.

Ender.uNF posted:

Is there any way we can get "auto" in Objective-C? I'd rather not convert all my files to mm but I soooo miss "var x = abc;" from C#. It gets so drat tiring repeating the type names twice on several lines in every method.

I can already hear the 410 objection that auto will infer id* in various cases but we already deal with that today by casting and that's exactly how you alter the inferred type in C#: "var x = (MoreDerived)GetFancy();"

I sometimes wish for generics but I guess I'd just have to adopt C++ for my iOS projects but then I have no runtime type information thanks to template instantiation. Honestly... I have no idea how people lived before reflection/introspection. Seems like you might as well write COBOL.

Why can't everything just be perfect and do what I mean?

It can! RubyMotion is just about the best thing to happen to iOS since the creation of iOS. I don't mean to seem like a shill, but I love it so much.

Toady
Jan 12, 2009

Jehde posted:

I'd like to iterate what was said before in that Obj-C is a hipster language, with what little exposure I've had to it so far.!

Still confused by this. Not to argue with personal opinion; it's just that nearly every criticism I've ever seen of Objective-C portrays it as old and uncool, so I'm amused that it's apparently now perceived as a hipster language.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I guess choosing to program in obj-c is sort of like choosing to ride a fixie.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Toady posted:

Still confused by this. Not to argue with personal opinion; it's just that nearly every criticism I've ever seen of Objective-C portrays it as old and uncool, so I'm amused that it's apparently now perceived as a hipster language.

Sometimes I get the impression that "hipster" means "something I vaguely don't like for some reason I can't articulate".

Echo Video
Jan 17, 2004

pokeyman posted:

Sometimes I get the impression that "hipster" means "something I vaguely don't like for some reason I can't articulate".

I substitute "somebody I'm worried is cooler than me" everytime somebody says hipster. It usually fits.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Ender.uNF posted:

Is there any way we can get "auto" in Objective-C? I'd rather not convert all my files to mm but I soooo miss "var x = abc;" from C#. It gets so drat tiring repeating the type names twice on several lines in every method.

I can already hear the 410 objection that auto will infer id* in various cases but we already deal with that today by casting and that's exactly how you alter the inferred type in C#: "var x = (MoreDerived)GetFancy();"

Lots of other things subvert this in ObjC, like 1 not being an NSInteger (you should care about 64-bit portability! honest!) and a<b not being a bool (much less a BOOL) and all the untyped enumerations in the headers (which we're doing something about in 4.4). But it's mostly the 'id' thing.

Ender.uNF posted:

I sometimes wish for generics but I guess I'd just have to adopt C++ for my iOS projects but then I have no runtime type information thanks to template instantiation. Honestly... I have no idea how people lived before reflection/introspection. Seems like you might as well write COBOL.

Generics in ObjC pose a lot of hard problems, not least of which being that protocol qualifiers managed to steal the standard/obvious syntax in a way that it's not clear we can work around.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

rjmccall posted:

Heh. Two-thirds of that talk was about ARC, general warnings, and static analysis. We can't even squeeze in fifteen minutes of announcing the most complete C++11 implementation on the planet without getting ragged on incessantly. :)

Haha, I just skimmed through it and it really was only 15 mins. I think at the time the C++ stuff might have been the only "new information" that had no overlap with other sessions, so maybe I noticed it more.

Oh My Science
Dec 29, 2008

Sinestro posted:

It can! RubyMotion is just about the best thing to happen to iOS since the creation of iOS. I don't mean to seem like a shill, but I love it so much.

I love the idea of using ruby, but $220.00 is a bit steep for something I would like to toy with. It would be more appealing to me if he made it free to use until it was time to publish. You know, just like we need an ios dev account to publish.

lord funk
Feb 16, 2004

ultramiraculous posted:

The sessions this year (Which just got posted)

w00t

Flipped through some of the audio session slides: multichannel audio output destinations and USB out are going to be fantastic. It's scary how viable the iOS platform has become for professional audio production.

Physical
Sep 26, 2007

by T. Finninho
Obj-C seems overly complicated, outdated, and elitist. That's close to what I think a hipster is, the elitist part anyway. And some of the outdated part.

A hipster is someone who thinks that they know how to do everything better than you, but works as a bartender or server for the rest of their lives. I dunno, just go hang out with some hipsters and you'll see. Mainly, they are bar-flys I think. Who have an inflated self-important and intelligence.

Much like Obj-c: "Obj-c is so much easier and better than all the other languages. Plus my Mac uses it."

(USER WAS PUT ON PROBATION FOR THIS POST)

Doc Block
Apr 15, 2003
Fun Shoe
What about it is overly complicated? If anything, to me it seems uncomplicated. Especially compared to other systems languages like C++.

Outdated? In what way? Don't say "No garbage collection", because Objective-C on OS X has had garbage collection for a long time. It was intentionally left out on iOS because of performance and memory constraints.

As to the elitist thing, I don't think I've ever heard anyone but morons seriously say that Objective-C is the best language ever.

some kinda jackal
Feb 25, 2003

 
 
Has anyone here done any work with tesseract optical character recognition?

I'd love to use it as an alternative (repetitive) text input method in an ipad app but I'd love to hear any firsthand reports.

Mainly because bringing up the on screen keyboard to enter numbers in like 20 separate fields seems annoying. I mean I would make it optional, but it would be baller if I could get numeric input through character recognition first.

fankey
Aug 31, 2001

When I first started writing my app a few years ago I used the recommendations of this book and made 3 different targets - one for emulation, one for ad hoc testing and one for the app store. If I'm using XCode 4.3 is there any reason to continue doing so? The Tools Workflow Guide shows that I should just have one target and create a copy of the release configuration for submitting to the store. Having multiple targets is a pain so if I don't need to do that anymore that'd be great.

Doc Block
Apr 15, 2003
Fun Shoe
You never needed to do that.

In any case, don't do it any more.

Coldrice
Jan 20, 2006


I have a question, I've trying to make a list of random nouns that match up with random adjectives as I saw demonstrated in a book, but I've noticed that every time I run a simulator its not actually random, its always the same combination in the same order every time. is this usual? (for example the first combination always comes out big bear, and then when I use the method again the second combo will always be shiny cat"

quote:

+(id)randomBattler
{
NSArray *randomAdjectiveList = [NSArray arrayWithObjects:@"Big",
@"Small",
@"Shiny",
@"Slimy",
@"Smelly",
@"Incapable",
@"Intelligent",
nil];

NSArray *randomNounList = [NSArray arrayWithObjects:@"Bear",
@"Bug",
@"Rat",
@"Man",
@"Robot",
@"Dinosaur",
@"Cat",
nil];

NSInteger adjectiveIndex = rand() % [randomAdjectiveList count];
NSInteger nounIndex = rand() % [randomNounList count];


NSString *randomName = [NSString stringWithFormat:@"%@ %@",
[randomAdjectiveList objectAtIndex:adjectiveIndex],
[randomNounList objectAtIndex:nounIndex]];

int newHealth = 4;

Battler *newBattler =
[[self alloc] initWithBattlerName:randomName
health:newHealth];
return newBattler;
}

I am really new at this so be gentle!!

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
rand() needs to be seeded, usually with the time. I just use arc4random(), which does not need to be seeded manually.

Objective-C random info

Filburt Shellbach
Nov 6, 2007

Apni tackat say tujay aaj mitta juu gaa!
I loving love Instruments. Couldn't imagine writing Objective C code without it.

lord funk
Feb 16, 2004

Filburt Shellbach posted:

I loving love Instruments. Couldn't imagine writing Objective C code without it.

Indeed. Early on in the development of my synth app, I ran the Time Profiler. It showed all my synthesis code, object by object, with the processing time of each object. :stare: Without that I never would have been able to optimize the thing enough to make it work.

Froist
Jun 6, 2004

Could anyone give me a pointer on OpenGL blend modes? Specifically in the context of Cocos2D, though I don't think that matters really.

I've been trying to combine some effects on some text in a game I'm working on - layering the text itself over a heavily blurred/coloured copy. I have the blur working fine but when I come to merge them in a CCRenderTexture it sets the blendFunc to {GL_ONE, GL_ONE_MINUS_SRC_ALPHA}, meaning I can't change the opacity of the resulting sprite.

To make it a bit clearer, this is a few components added to my view separately:


From top to bottom, they are:
  1. The plain text, rendered to a CCTexture2D (then wrapped in a CCSprite for drawing)
  2. The blurred text, rendered to a CCTexture2D (again wrapped in a sprite and coloured)
  3. Copies of the above two sprites placed at the same position in the view
  4. The single sprite created by the CCRenderTexture operation of drawing these sprites together to an off-screen bitmap
  5. The result of copying the CCTexture2D from [4] into a new CCSprite object (which doesn't have the custom blendFunc set)

Basically [4] looks exactly how I'd like it to look, except it's the only one where fading the opacity has no effect, seemingly due to the blendFunc. [3] looks identical at full opacity, but the white text turns pink when it fades in/out as the opacity of the text sprite allows the blur to show through. This is the code I'm using to generate 4:
code:
    // CCTexture2D objects already created for blur and text

    CCSprite *blurSprite = [CCSprite spriteWithTexture:blurTexture];
    CCSprite *textSprite = [CCSprite spriteWithTexture:labelTexture];
    [blurSprite setColor:ccc3(255, 0, 0)];

    CCRenderTexture* rt = [CCRenderTexture renderTextureWithWidth:textureWidth
                                                           height:textureHeight];
    [rt begin];
    [blurSprite visit];
    [textSprite visit];
    [rt end];

    CCSprite *renderedText = [[rt sprite] retain];
    [renderedText removeFromParentAndCleanup:NO];
    [self addChild:renderedText];
Is there any way I can get this working with the output of CCRenderTexture? Or any other way of flattening these two sprites together into one? I wouldn't be averse to doing it outside Cocos2D APIs if it would be easier but I don't really know any of the stock image libraries.

Edit: I'm using kEAGLColorFormatRGBA8 as my pixel format for the whole project, if that makes a difference.

Froist fucked around with this message at 09:55 on Jun 25, 2012

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Anyone have experience localizing an app and trying to duplicate screenshots for all the different languages?

For almost all my views you could, in theory, just take a somewhat similar screenshot and overlay the changed text but that's a lot of photoshop. Otherwise it will take a bunch of fiddling and switching of my simulator between languages to get them done. I wish there was a demo script system that could do the work.


Cutting and pasting all the descriptions and in-app purchase stuff in iTC has been almost as much work as actual localization. Is it any surprise people don't bother?


edit: gently caress me, I just realized I need to do this for the free version and iPad too so that's 5*2*2*5 = 100 screenshot files I need to create. AKSDJFA

Simulated fucked around with this message at 00:31 on Jun 25, 2012

Adbot
ADBOT LOVES YOU

OHIO
Aug 15, 2005

touchin' algebra

Ender.uNF posted:

Anyone have experience localizing an app and trying to duplicate screenshots for all the different languages?

For almost all my views you could, in theory, just take a somewhat similar screenshot and overlay the changed text but that's a lot of photoshop. Otherwise it will take a bunch of fiddling and switching of my simulator between languages to get them done. I wish there was a demo script system that could do the work.


Cutting and pasting all the descriptions and in-app purchase stuff in iTC has been almost as much work as actual localization. Is it any surprise people don't bother?

Yeah it's tedious. What languages are you supporting? I've found it to be worthwhile though when a random non-english blog features the app because of the localization.

Hey how has your SA ad campaign been going?

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