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
dizzywhip
Dec 23, 2005

quote:

Here's a possibly dumb question: Assuming I am going to back off and build my knowledge of C or Python, can I still use Xcode for both of those languages? I'm guessing C: yes and Python: no. In fact now that I look more closely at the Python site I'm sure of it.

I believe that Xcode supports custom build scripts, so you could in theory use it to write Python, but I wouldn't really recommend it. It'd be better to use a more lightweight text editor like Sublime Text or TextMate along with the command line.

Actually, an app I came across recently called CodeRunner would be pretty good for starting out. It seems aimed towards beginners and lets you run your code directly inside the app. It's a lot cheaper than Sublime Text and TextMate too.

Even if you do go with CodeRunner you should still learn how to compile and run your code via the command line.

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
Yes, learn to use the command line to compile your code. Especially for C, C++, and Objective-C, because even if you only use an IDE for your production code, understanding C's separate compilation model is important.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

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?

To me it's more of a motivation question. Can you spend an hour or two coding each day on your own stuff? If not, maybe taking a class will get you into a text editor.

Haud
Dec 6, 2007

World's Worst Interview

SheepThrowinBoy posted:



Nthing what everyone else has said so far: take a few steps back and just learn how to program in the command prompt for awhile and even drop XCode and open up your text editor and go from there. It's more important to have a base-knowledge of how these languages work and what all the syntaxes can do before you have to start worrying about building a GUI with delegates and events and all that advanced stuff.

I taught myself how to program by reading a bunch of books, and the first book I ever read was about C# done through Notepad and compiling through the cmd prompt in Windows. It was absolutely tedious as gently caress, but it taught me a lot about compilers and just let me focus on understanding the syntax of the language -- starting with data types, understanding if/while statements, building into methods and then into classes, etc. Once you have this base-knowledge, then jumping into iOS is less intimidating because instead of learning BOTH language-syntax AND iOS development tools at the same time, you can just learn the development tools and not have to stop and be like "...wait, what exactly is a delegate anyway?"

Learn one thing at a time. Learn how to program, then you can learn how to develop a full-fleshed app.

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.

LP0 ON FIRE
Jan 25, 2006

beep boop
Is it safe to call just [self methodName:] on a method that has only a BOOL parameter? I'm using it on a selector in Cocos2D like this: id actionRestoreEnergy = [CCCallFuncN actionWithTarget:self selector:@selector(restoreHeroEnergy:)];

The only reason I want to do it this way is because that selector doesn't need to send a YES message in that particular instance, and I don't feel like doing all the data stuff and changing my method because it seems like it does the same thing as long as it's not causing leaks to memory and such.

edit: Actually this is bad because it is always returning YES with just restoreHeroEnergy:

LP0 ON FIRE fucked around with this message at 19:25 on Feb 3, 2012

dizzywhip
Dec 23, 2005

LP0 ON FIRE posted:

Is it safe to call just [self methodName:] on a method that has only a BOOL parameter? I'm using it on a selector in Cocos2D like this: id actionRestoreEnergy = [CCCallFuncN actionWithTarget:self selector:@selector(restoreHeroEnergy:)];

The only reason I want to do it this way is because that selector doesn't need to send a YES message in that particular instance, and I don't feel like doing all the data stuff and changing my method because it seems like it does the same thing as long as it's not causing leaks to memory and such.

If the value of the argument doesn't matter, why not just pass in an arbitrary value instead of not passing anything and hoping it works? If you want to make it clear that the parameter doesn't matter in this case, make another method called restoreHeroEnergy that doesn't take any argument and just calls the actual method with a default value.

edit:

quote:

edit: Actually this is bad because it is always returning YES with just restoreHeroEnergy:

I imagine that what's actually happening is that self is being passed in as the parameter, which evaluates to true since it isn't null. If you need the value of the parameter to be NO then just pass in NO.

dizzywhip fucked around with this message at 19:39 on Feb 3, 2012

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

LP0 ON FIRE posted:

Is it safe to call just [self methodName:] on a method that has only a BOOL parameter? I'm using it on a selector in Cocos2D like this: id actionRestoreEnergy = [CCCallFuncN actionWithTarget:self selector:@selector(restoreHeroEnergy:)];

I'm curious, what does the implementation get as a parameter when you don't pass one? Or, similarly (in appearance if not explanation), why does it work to give NSTimer a selector that takes no parameters?

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
CCCallFuncN expects the selector to take a single CCNode* argument. You're not going to get wild misbehavior on any of Apple's current platforms, but the parameter's not going to have a useful value; it's basically just going to be 8 bits out of a pointer value, and which bits you get exactly is platform-dependent.

pokeyman posted:

I'm curious, what does the implementation get as a parameter when you don't pass one? Or, similarly (in appearance if not explanation), why does it work to give NSTimer a selector that takes no parameters?

Well, it's relatively easy to check a selector to see how many parameters it takes, but you actually don't need to in this case: as long as the calling convention isn't callee-pop (which the default CC is not, at least on any of Apple's platforms), it's always safe to pass extra arguments to a function. Well, except that it's undefined behavior and the compiler might optimize it, but (and this is not a promise) the compiler is unlikely to ever do that with ObjC message-sends.

rjmccall fucked around with this message at 19:56 on Feb 3, 2012

wwb
Aug 17, 2004

I'm working on finding a crash reporting solution for an app we'll be publishing shortly. I came upon Quincy Kit. Is anyone familiar with it and does it work as advertised?

LP0 ON FIRE
Jan 25, 2006

beep boop

Gordon Cole posted:

If the value of the argument doesn't matter, why not just pass in an arbitrary value instead of not passing anything and hoping it works? If you want to make it clear that the parameter doesn't matter in this case, make another method called restoreHeroEnergy that doesn't take any argument and just calls the actual method with a default value.

I imagine that what's actually happening is that self is being passed in as the parameter, which evaluates to true since it isn't null. If you need the value of the parameter to be NO then just pass in NO.

In my case I'm using selector, and if I did want to send any kind of message it would look something like this: [CCCallFuncND actionWithTarget:self selector:@selector(restoreHeroEnergy : data:) data:[[NSNumber numberWithBool:NO] retain]];

And then I'd need to edit the restoreHeroEnergy method and also take into account to release that NSNumber. I guess not such a big deal but why make things look more messy if restoreHeroEnergy in that selector.. but I now know that's not the case.

LP0 ON FIRE fucked around with this message at 20:52 on Feb 3, 2012

dizzywhip
Dec 23, 2005

I've never used Cocos2D so I'm probably missing something here, but what's the purpose of calling the method that way rather than doing [self restoreHeroEnergy: NO]?

LP0 ON FIRE
Jan 25, 2006

beep boop

Gordon Cole posted:

I've never used Cocos2D so I'm probably missing something here, but what's the purpose of calling the method that way rather than doing [self restoreHeroEnergy: NO]?

Good question. I should have cleared that up first. CCCallFuncN can be used on an action definition to be run in a certain sequence with the runAction method. Actions can be used on sprites to move to a certain location, fade out, etc, and then a function action can be run anytime in that sequence to call methods. CCCallFuncN doesn't support just passing any type of parameter, so you need to set it in node data.

Small White Dragon
Nov 23, 2007

No relation.

Bob Morales posted:

Dink around with Ruby/Python or something for a little bit and jump into C/Objective-C
As someone who spent a few years teaching programming, I'm going to second this advice.

C/C++/ObjC are comparatively difficult and not good starter languages for novices.

dizzywhip
Dec 23, 2005

I'm having a really bizarre issue with NSPopover. I noticed recently that my popovers had stopped animating when they're opened or closed, and I narrowed the cause down to when I changed my app's bundle identifier. When I set the identifier to what it used to be, the popovers start animating again, and when I change it back they stop.

I have no idea why that would affect something like this. There are no references to the old identifier anywhere in my project, and it's affecting popovers that were created both before and after the change.

Does anyone have any idea why this could be happening?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
No idea, and that sounds sufficiently bizarre to file a bug if you can get it down to a simple sample project.

dizzywhip
Dec 23, 2005

I actually just figured it out after I realized the animation would work for any identifier different from my current one. It requires a bit of background to explain though.

A while back I needed to put a color picker in my app, but I hate the lovely floating window the default color picker sits in, so I decided to try and put the color picker into a popover.

It's kind of janky, but basically I'm ripping out the contents of that window and just putting them into a view that gets used by the popover. It actually works really well, except that I'm using the color picker with a color well, and when you click on the color well it tries to summon the picker window. I'm getting around that by overriding the activate method of NSColorWell to immediately hide the window as soon as it's summoned.

The problem with that is that in Lion, the window animates as it's being opened and closed, so you see the window flash on screen for a moment. I've gotten around that by disabling window animations temporarily when the panel gets opened and closed:

code:
- (void) activate: (BOOL)exclusive {
	BOOL defaultAnimationSetting = [[NSUserDefaults standardUserDefaults] boolForKey: @"NSAutomaticWindowAnimationsEnabled"];
	
	[[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"NSAutomaticWindowAnimationsEnabled"];
	[super activate: exclusive];
	[[NSColorPanel sharedColorPanel] orderOut: self];
	[[NSUserDefaults standardUserDefaults] setBool: defaultAnimationSetting forKey: @"NSAutomaticWindowAnimationsEnabled"];
	
	[popover showRelativeToRect: self.bounds ofView: self preferredEdge: NSMinYEdge];
}
The problem, I guess, is that at some point the animations got disabled but somehow didn't get reenabled, and the saved preference was associated with my app's bundle ID.

I think I'm just going to write my own color well class to avoid this whole situation.

HolyJewsus
Jun 26, 2006
Disgruntled By Flashing and Blinking Lights.

pokeyman posted:

In the blog post I linked, look at when the plugin gets initialized (SetupTrackingObject). It reaches into the application to find the main window, then finds the content view of the main window, and inserts the plugin itself as the next responder after the view. What this does is cause any events not handled by the main view (such as touchesBegan, touchesEnded, etc.) to fall through to the plugin, giving the plugin a chance to respond to the events. (What it should also do is set the plugin's next responder to the view's old next responder, so the chain isn't broken. What you should also do is call super so the window doesn't stop working.)

The events that NSView listens to are defined on its superclass, NSResponder. Override the methods you're interested in (just like the Cocoa Simple view does) such as -mouseDown: in your plugin, insert your plugin into the responder chain, and see if you get the events coming through. Once you get the events, you should be able to grab their pressure data and call back into your Unity code.

hey thanks so much for this, really helped me get closer. Right now I have wacom data coming into my unity builds, doesn't work properly in the editor but thats cool, and it doesn't work when unity goes fullscreen but I think thats part of nsborderlesswindowmask style that unity does...



can you fill me in on how to do this part of your advice? :

What it should also do is set the plugin's next responder to the view's old next responder, so the chain isn't broken. What you should also do is call super so the window doesn't stop working.) I've looked up super but I'm not sure what you mean.

duck monster
Dec 15, 2004

By the way guys, if any of you are looking for any work to keep the rent paid while in college, oDesk has loving tonnes of iphone/ipad contracts and seems easy to get work in. Don't get too put off by all the indian dudes quoting at $10 an hour, as a lot of people are very wary of that sort of thing and would prefer to pay a bit more for an American who charges fair prices. Caveat emptor, read the "elance is a clusterfuck" thread for some warnings on it all though.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

HolyJewsus posted:

can you fill me in on how to do this part of your advice? :

What it should also do is set the plugin's next responder to the view's old next responder, so the chain isn't broken. What you should also do is call super so the window doesn't stop working.) I've looked up super but I'm not sure what you mean.

For the next responder part, you should do
code:
[pressureMonitor setNextResponder:[windowContentView nextResponder]];
[windowContentView setNextResponder:pressureMonitor];
This way, for events you don't handle, the window gets a chance to handle it. In order for the window to get a chance, however, you'll need to do something like
code:
- (void)mouseDown:(NSEvent *)theEvent
{
    // do your stuff
    if (somethingElseOnTheWindowMightCareAboutThisEventSuchAsAButton)
        [super mouseDown:theEvent];
}
NSView's implementation of -mouseDown: will pass it along to the next responder for you.

What I'm trying to get across is that you're just looking to grab the pressure data, not necessarily swallow all the e.g. mouse down events. If you keep the responder chain intact and call super in your event handlers, all's good. If you don't, you might get weird stuff like buttons not working when you click on them.

Of course, if you want to disable the normal functioning of e.g. mouse down, don't call up to super.

pokeyman fucked around with this message at 19:15 on Feb 6, 2012

HolyJewsus
Jun 26, 2006
Disgruntled By Flashing and Blinking Lights.

pokeyman posted:

For the next responder part, you should do
code:
[pressureMonitor setNextResponder:[windowContentView nextResponder]];
[windowContentView setNextResponder:pressureMonitor];
This way, for events you don't handle, the window gets a chance to handle it. In order for the window to get a chance, however, you'll need to do something like
code:
- (void)mouseDown:(NSEvent *)theEvent
{
    // do your stuff
    if (somethingElseOnTheWindowMightCareAboutThisEventSuchAsAButton)
        [super mouseDown:theEvent];
}
NSView's implementation of -mouseDown: will pass it along to the next responder for you.

What I'm trying to get across is that you're just looking to grab the pressure data, not necessarily swallow all the e.g. mouse down events. If you keep the responder chain intact and call super in your event handlers, all's good. If you don't, you might get weird stuff like buttons not working when you click on them.

Of course, if you want to disable the normal functioning of e.g. mouse down, don't call up to super.

ah ha!, thanks, gotcha.

lord funk
Feb 16, 2004

Odd question: is there a place where you can copy the text from your user reviews on the App Store? iTunes won't let me select the text. :(

xelfer
Nov 27, 2007

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

lord funk posted:

Odd question: is there a place where you can copy the text from your user reviews on the App Store? iTunes won't let me select the text. :(

Do you mean reviews you've left or the reviews on apps you own? if it's the latter you could try something like AppViz, the screenshot showing reviews looks like a copyable text field: http://www.ideaswarm.com/images/Reviews.jpg

lord funk
Feb 16, 2004

xelfer posted:

Do you mean reviews you've left or the reviews on apps you own? if it's the latter you could try something like AppViz, the screenshot showing reviews looks like a copyable text field: http://www.ideaswarm.com/images/Reviews.jpg

Looks good, but I don't know if my laziness about manually typing things in is worth $50. :v:

skidooer
Aug 6, 2001

lord funk posted:

Looks good, but I don't know if my laziness about manually typing things in is worth $50. :v:

If it is your app, all of the reviews are accessible in iTunes Connect in plain old HTML. There is a link the them on the version detail page; the same place the promo codes button is.

skidooer fucked around with this message at 05:32 on Feb 7, 2012

lord funk
Feb 16, 2004

skidooer posted:

If it is your app, all of the reviews are accessible in iTunes Connect in plain old HTML. There is a link the them on the version detail page; the same place the promo codes button is.

Brilliant! Thanks.

duck monster
Dec 15, 2004

Any unemployed australians in here up for some work?

xelfer
Nov 27, 2007

What's new, Buseycat? woa-aah, woa-aah, woa-aah
full time or contract? private message me details if you like. :)

xelfer
Nov 27, 2007

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

duck monster posted:

Any unemployed australians in here up for some work?

cant reply mailbox is full. :)

duck monster
Dec 15, 2004

xelfer posted:

cant reply mailbox is full. :)

Eep. Let me sort that out now. Ok try now

duck monster fucked around with this message at 13:02 on Feb 7, 2012

WARnold
Oct 30, 2004

You Lack Discipline!
.

WARnold fucked around with this message at 20:31 on Oct 29, 2019

dizzywhip
Dec 23, 2005

Isn't this exactly the sort of service that Apple just warned developers to never use? How do you generate your app store reviews?

WARnold
Oct 30, 2004

You Lack Discipline!
.

WARnold fucked around with this message at 20:31 on Oct 29, 2019

Carthag Tuek
Oct 15, 2005

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



I was going to implement a source list, but it's causing XCode and the Simulator to freak out:

code:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '-[NSOutlineView ibIsInDesignMode]: unrecognized selector sent to instance 0x400429e40'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff859eb286 __exceptionPreprocess + 198
	1   libobjc.A.dylib                     0x00007fff8298ad5e objc_exception_throw + 43
	2   CoreFoundation                      0x00007fff85a774ce -[NSObject doesNotRecognizeSelector:] + 190
	3   CoreFoundation                      0x00007fff859d8133 ___forwarding___ + 371
	4   CoreFoundation                      0x00007fff859d7f48 _CF_forwarding_prep_0 + 232
	5   AppKit                              0x00007fff83f571e1 -[NSTableView(NSTableViewViewBased) _isInDesignMode] + 38
	6   AppKit                              0x00007fff83ef0d51 -[NSTableView(NSTableViewViewBased) _hasDelegateSupportOrArchivedViews] + 77
	7   AppKit                              0x00007fff83f5718a -[NSTableView(NSTableViewViewBased) shouldUseViews] + 16
	8   AppKit                              0x00007fff83f570d1 -[NSTableView _updateRowData] + 25
	9   AppKit                              0x00007fff83f56ba5 -[NSTableView _commonTableViewInit] + 799
	10  AppKit                              0x00007fff83f555e9 -[NSTableView initWithCoder:] + 2711
	11  AppKit                              0x00007fff8409eada -[NSOutlineView initWithCoder:] + 54
	12  Foundation                          0x00007fff8e25286b _decodeObjectBinary + 2860
... etc ...
Google has nothing. Anyone seen this before?

OHIO
Aug 15, 2005

touchin' algebra

Carthag posted:

I was going to implement a source list, but it's causing XCode and the Simulator to freak out:


Google has nothing. Anyone seen this before?

Whoa that's weird. I mean that's a classic 'wrong selector' exception which I've seen too many times, but it looks like it's coming from a nib being loaded... I assume it's not reaching any of your personal code? Like some setting in Interface Builder got corrupted? 'ibIsInDesignMode' isn't something you specified, right?

Carthag Tuek
Oct 15, 2005

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



Yeah it's all in the simulator, not my own code. I've just tried these three steps three times with the same result (also with a fresh new project):

1. Create window nib
2. Add a source list
3. Menu: Editor > Simulate Document

From the stacktrace it looks like the simulator is loading the nib, and the view then tries to figure out where the data should come from, and apparently has a fallback to some Interface-Builder specific code that explodes?

Carthag Tuek fucked around with this message at 19:14 on Feb 8, 2012

wwb
Aug 17, 2004

wwb posted:

I'm working on finding a crash reporting solution for an app we'll be publishing shortly. I came upon Quincy Kit. Is anyone familiar with it and does it work as advertised?

Any ideas? Got buried under real good questions and paying work . . .

dizzywhip
Dec 23, 2005

WARnold posted:

Nope, Apple's warning was about the service in the Toucharcade post. (some company created a network of download bots that downloaded the poo poo out of apps to get them to the top ranks.)

We do no such thing. Instead we have a handful of reviewers who download the app, take a look, and write reviews on app store.

We do not manipulate rankings, and will never do so.

How is downloading an app and giving fake reviews not manipulating rankings?

xzzy
Mar 5, 2009

Gordon Cole posted:

How is downloading an app and giving fake reviews not manipulating rankings?

But they're not fake! The reviewers actually downloaded the app and "took a look" at it, so clearly it is an unbiased objective review that just so happened to have some financial motivation behind it.

If there's one thing the internet loves, it's some astroturfing.

Adbot
ADBOT LOVES YOU

LP0 ON FIRE
Jan 25, 2006

beep boop
Since my entire scene in cocos2D gets replaced during transitions when I still need a text layer to stay unaltered, I needed to abandon cocos2D sprite text for that layer. I added a UIView in front tested the replacement with a UILabel, and everything is running smoothly. But this a UILabel...not outlined sprite text.

Does anyone know of some handy code or framework that would work as a good sprite text replacement that can be shown in a UIView?

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