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
Small White Dragon
Nov 23, 2007

No relation.
Rather than writing it in Objective C and porting it later for Android, I'd like to try simultaneous development for an upcoming project. Anybody else doing this, and if so, what are you using? MonoTouch?

Adbot
ADBOT LOVES YOU

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.

Small White Dragon posted:

Rather than writing it in Objective C and porting it later for Android, I'd like to try simultaneous development for an upcoming project. Anybody else doing this, and if so, what are you using? MonoTouch?

I have been playing around with RubyMotion a bit, and it is pretty great. C# is a language to use for its libraries, and MonoTouch doesn't have those.

Mikey-San
Nov 3, 2005

I'm Edith Head!

Martytoof posted:

Ah, fair enough.

I wonder if there is a way to deliver suggestions like this to Apple. It doesn't feel like something that ought to go into the Bug Reporter but I think that's actually exactly where it needs to be suggested.

Bug Reporter is the right place to file enhancement requests.

CeciPipePasPipe
Aug 18, 2004
This pipe not pipe!!

pokeyman posted:

What are you stuck on? QA1719 seems to lay it out nicely for you. Everything in your list needs to be backed up and kept under low storage conditions, so that means ~/Documents. If you can live without the data being backed up, Library/Private Documents with the extended attribute set.

OK, I saw several stories on StackExchange and other places where people were being rejected because their apps downloaded (data) updates (even just 1-2 MB) and stashed them in the wrong place and/or with the wrong attribute set. Looks like a lot of hassle if you want to comply with every OS version: iOS 5.0.0 needs everything in Library/Caches, iOS 5.0.1 can have it elsewhere (Library/Application Support/appId) with the setxattr, iOS 5.1 needs that other metadata flag. If the user upgrades iOS you'd probably need to migrate the files/folders and flags around too?

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

Sinestro posted:

I have been playing around with RubyMotion a bit, and it is pretty great. C# is a language to use for its libraries, and MonoTouch doesn't have those.

I'd have to disagree, it is an awesome language.

Kallikrates
Jul 7, 2002
Pro Lurker
We are going with a custom hybrid: Thin objective-C wrapper to manage alot of different types of webviews. We had very early experiments with phonegap, and didn't really like it.

Tarq
Apr 25, 2008

by Ralp
I found out about an interesting project today, and I'm not sure the best way to proceed.

I'm working on an iPad app which among other things allows sharing of medical images to providers. The problem is that any personal information has to be redacted or blurred out.

The main use case would be someone taking a picture of an x-ray and the patients name might be on the bottom right of the scan. What would be really sweet would be a way to identify any text in an image and auto-blur it, but that sounds pretty out there. At a minimum I'd like to do like a touch to redact or blur.

Can you guys recommend a good image library?

Kallikrates
Jul 7, 2002
Pro Lurker
IANAL, but wouldn't the information have to be redacted before it ever got to the ipad?

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





Does everyone just use Glyphish (or custom bespoke stuff) for icons, or is there an alternative I've overlooked? I've been doing iOS development for a year and a half now, but mostly network layer stuff. This is my first time working on the UX and there's literally a billion things I thought I knew but don't.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
I'm sure some have seen this before, but I just saw this on Daring Fireball and thought this thread would enjoy:

http://textfromxcode.tumblr.com/

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

the talent deficit posted:

Does everyone just use Glyphish (or custom bespoke stuff) for icons, or is there an alternative I've overlooked? I've been doing iOS development for a year and a half now, but mostly network layer stuff. This is my first time working on the UX and there's literally a billion things I thought I knew but don't.

Jesus, how did I never hear about Glyphish before? That would have saved me a lot of time, and probably resulted in my apps looking better.

Tarq
Apr 25, 2008

by Ralp

Kallikrates posted:

IANAL, but wouldn't the information have to be redacted before it ever got to the ipad?

In many cases info is getting there via the camera.

lord funk
Feb 16, 2004

I seem to be staring at assembly code again when the debugger breaks. I have a breakpoint set for all Objective-C exceptions, and I do not have 'Show Disassembly When Debugging' set. Any other places to check in Xcode to see my code instead?

I should mention it's probably a threading error I'm hitting - I'm mutating an NSSet while it's being enumerated somewhere.

Kallikrates
Jul 7, 2002
Pro Lurker

lord funk posted:

I seem to be staring at assembly code again when the debugger breaks. I have a breakpoint set for all Objective-C exceptions, and I do not have 'Show Disassembly When Debugging' set. Any other places to check in Xcode to see my code instead?

I should mention it's probably a threading error I'm hitting - I'm mutating an NSSet while it's being enumerated somewhere.

managed contexts? That was a fun bug to chase down.
If so: accessing them and editing them are not thread safe, make sure you are on the same thread you created them with, or go through a parent context.

Kallikrates fucked around with this message at 06:39 on Jun 8, 2012

Zhentar
Sep 28, 2003

Brilliant Master Genius
I'm pretty sure the answer to this is no, but is there anyway under ARC to explicitly autorelease something? Basically, I need a __bridge_retain_autorelease. (Without going into too much detail, I have a legitimate use case for something explicitly unsupported by ARC; an ARC autorelease would just let me keep the impact of the lifetime management to one line).

Fake edit: could I just call objc_autorelease myself?

Real edit: great, the rewriter strips out all retains from properties, but no one told the warnings the default is strong now. So I've got many hundreds of warnings now. Awesome.

Zhentar fucked around with this message at 18:23 on Jun 8, 2012

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Zhentar posted:

I'm pretty sure the answer to this is no, but is there anyway under ARC to explicitly autorelease something? Basically, I need a __bridge_retain_autorelease. (Without going into too much detail, I have a legitimate use case for something explicitly unsupported by ARC; an ARC autorelease would just let me keep the impact of the lifetime management to one line).

You can make a local __autoreleasing variable and assign to it.

Zhentar posted:

Fake edit: could I just call objc_autorelease myself?

No. If this isn't marked unavailable in ARC, it should be; also, that would cause an over-release because the autorelease will not be balanced.

Zhentar posted:

Real edit: great, the rewriter strips out all retains from properties, but no one told the warnings the default is strong now. So I've got many hundreds of warnings now. Awesome.

Really? File a bug, please. I also strongly encourage you to try the Xcode 4.4 preview if you can.

Small White Dragon
Nov 23, 2007

No relation.
So top rumor on MacRumors is that we might actually see third-party apps on the AppleTV.

Zhentar
Sep 28, 2003

Brilliant Master Genius

rjmccall posted:

You can make a local __autoreleasing variable and assign to it.

Ah! It looks like that will work, then. I think I misunderstood how __autoreleasing works when I read the documentation previously.

rjmccall posted:

Really? File a bug, please. I also strongly encourage you to try the Xcode 4.4 preview if you can.

Stack Overflow linked me to a fixed bug report about it, so it is hopefully fixed for 4.4; I'll go ahead and give it a try. I also ran into one other issue, where a number of assign properties in class extensions got the "weakweak" attribute, but the first google hit for that one was an llvm commit fixing the issue.

Rockybar
Sep 3, 2008

I'm beginning to learn Objective-C (I already know some C) and I have a question about the syntax of the @implementation section.

Let's say you have this code: (taken from Programming in Objective-C by S. Kochan)
code:
@implementation Fraction
{
int numerator;
}
-(void) setNumerator: (int) n
{
numerator = n;
}
While I understand the function that is being defined here (to get a function such as [frac setNumerator: 2]), I fail to see why it is necessary to have "(int) n", and then to have to declare "numerator = n". Why not simply have "setNumerator: (int) numerator;"? Is it to do with being able to use the instance variable "numerator" throughout the implementation without its value being modified?

Thank you for your understanding when reading what I assume is a very stupid question.

mewse
May 2, 2006

Rockybar posted:

While I understand the function that is being defined here (to get a function such as [frac setNumerator: 2]), I fail to see why it is necessary to have "(int) n", and then to have to declare "numerator = n". Why not simply have "setNumerator: (int) numerator;"? Is it to do with being able to use the instance variable "numerator" throughout the implementation without its value being modified?

Thank you for your understanding when reading what I assume is a very stupid question.

The method "setNumerator" is from a design pattern called getters/setters where you can't access an objects instance variables directly from outside the object, you have to use methods defined by the object's class.

So setNumerator just takes a single argument, calls it n, and then sets the "numerator" instance variable to the value of n. If the argument was also called numerator then things would get screwed up when it tried to set numerator to numerator.

dizzywhip
Dec 23, 2005

Rockybar posted:

I'm beginning to learn Objective-C (I already know some C) and I have a question about the syntax of the @implementation section.

Let's say you have this code: (taken from Programming in Objective-C by S. Kochan)
code:
@implementation Fraction
{
int numerator;
}
-(void) setNumerator: (int) n
{
numerator = n;
}
While I understand the function that is being defined here (to get a function such as [frac setNumerator: 2]), I fail to see why it is necessary to have "(int) n", and then to have to declare "numerator = n". Why not simply have "setNumerator: (int) numerator;"? Is it to do with being able to use the instance variable "numerator" throughout the implementation without its value being modified?

Thank you for your understanding when reading what I assume is a very stupid question.

Parameters and local variables shadow instance variables. If the parameter was named numerator, the instance variable would become inaccessible, so you wouldn't be able to set its value. The compiler would give you a warning.

A common convention in Objective-C is to prefix instance variables with an underscore, so it would look something like this instead.

code:
@implementation Fraction {
    int _numerator;
}

- (void) setNumerator: (int)numerator {
    _numerator = numerator;
}

@end
In practice, you wouldn't manually write out simple getters and setters like this. You would use a @property declaration, which I assume will be covered as you get further into your book.

Rockybar
Sep 3, 2008

Thanks for clearing that up. I'm actually quite a bit further in that book, but I'm just trying to wrap my head around @interface and @implementation as I begin to write short programs to test my knowledge.

lord funk
Feb 16, 2004

Kallikrates posted:

managed contexts? That was a fun bug to chase down.
If so: accessing them and editing them are not thread safe, make sure you are on the same thread you created them with, or go through a parent context.

In the end, I found exactly who was trying to push a value through the problem array, and just told it to shut up until the array was done being reworked. A bit hacky, but what about my app isn't...

Zhentar
Sep 28, 2003

Brilliant Master Genius

Gordon Cole posted:

If the parameter was named numerator, the instance variable would become inaccessible, so you wouldn't be able to set its value.

This isn't strictly true - you can still do self->numerator to access the instance variable.

dizzywhip
Dec 23, 2005

That's true. I'm pretty sure you'll still receive a compiler warning though, unless you turn it off.

Built 4 Cuban Linux
Jul 15, 2007

i own america
Is there any sort of premade toolkit or class available so I can easily implement chat in my app? I can do the backend stuff pretty easily (and I'd have to do it myself since I want it to communicate with my own servers) but if necessary I don't want to waste my time replicating the Messages app (bubbles for each part of the conversation, etc). Words With Friends (for example) looks like it reimplemented this to copy the look of the Messages app. Will I have to do the same?

duck monster
Dec 15, 2004

Built 4 Cuban Linux posted:

Is there any sort of premade toolkit or class available so I can easily implement chat in my app? I can do the backend stuff pretty easily (and I'd have to do it myself since I want it to communicate with my own servers) but if necessary I don't want to waste my time replicating the Messages app (bubbles for each part of the conversation, etc). Words With Friends (for example) looks like it reimplemented this to copy the look of the Messages app. Will I have to do the same?

"<function> ios github" is my magic google-fu

First result

https://github.com/chrisballinger/Off-the-Record-iOS

Jehde
Apr 21, 2010

First time you'll see my name here so I suppose I should give a bit of background, or my lack thereof: Absolutely no Apple experience outside of dinking around in OS X/friends iPhones/etc. I'm just finishing my undergrad in Computing Science learning with Java/C++ mainly, so no experience with Objective-C, Xcode, or anything related. I don't really have access to any Macs either outside of a few Mac labs on campus that run Xcode 3.

Now, I'm currently doing a term project to create an interactive map (ala Google Maps) iPhone app. We're expected to get a prototype working in a single week.

The idea is to have a vector-based image map (scalable) of polygons that represent buildings, with internal polygons that represent rooms in the buildings (Think mall directory style). There would be an underlying network of nodes for each room that the app would pathfind through to plot out a directive line between rooms. This ofcourse being the main feature of the app, pathfinding through complex buildings to find rooms.

Thankfully I'm not expected to have a full map created for the first prototype, not even a full building, so I'll only need to make a basic placeholder map that'll showcase the elementary pathfinding.

So, where the hell do I start? I've already got a basic "tabbed application" layout going for the preliminary UI, but how do I go about putting a frame in one of those tabs to hold a vector-based map? I've googled around and stumbled on Quartz 2D, which various sites call the API to use for vector images on iOS. To actually construct the images seem straight forward enough (though tedious), but it's how to use that created image in Xcode that gets me. Has anyone done anything similar that would have any tips? If anyone has any tips on how to do the next step after getting the map into the app (which is pathfinding), that'd be super helpful too. Would it be possible to append data to the visual objects Quartz 2D creates?

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Has anyone else noticed an "Add Content" button on their in-app purchase records in iTunes Connect?

There also appears to be a field that says "Hosting Content with Apple: This feature is turned off. If you want Apple to host content for your In-App Purchase, click Add Content."

I'm not sure if that is a mistake or if Apple intends to start hosting content for in-app purchases.


Also: localizing is a PITA with dynamically downloaded content, since the string resources aren't in your app bundle and you can't just use NSLocalizedString(). Good times, good times. I hope those hilarious foreigners buy my app because this is a ton of work.

Let me plug for those Wordcrafts guys in Germany: they are pretty good - they were the only ones I got quotes from that really knew Apple/Xcode development workflows so I didn't have to waste a ton of time getting my resources into a single file or special formats, just ship off the .strings and XIB files. They also resign the IPAs on their own so I didn't have to hand-hold them for beta testing the translated app and they knew to ask for the App Store descriptions and keywords. Check them out if you need to get something localized.

For reference, getting Storm Sim done is going to cost less than $1000* for Spanish, German, French, Japanese, and Chinese... so if you think it is too expensive you might want to check again.


*I am not translating the help file, that was going to more than double the cost. If the sales justify it I will look at translating that and/or the website in the future.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Ender.uNF posted:

Has anyone else noticed an "Add Content" button on their in-app purchase records in iTunes Connect?

There also appears to be a field that says "Hosting Content with Apple: This feature is turned off. If you want Apple to host content for your In-App Purchase, click Add Content."

I'm not sure if that is a mistake or if Apple intends to start hosting content for in-app purchases.

They are indeed hosting content for IAP.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.

Lumpy posted:

I'm sure some have seen this before, but I just saw this on Daring Fireball and thought this thread would enjoy:

http://textfromxcode.tumblr.com/
I have to give this some love. My coworkers and I loved it.

N
YOU MEAN NSSTREAM
NS
YOU MEAN NSSTREAM
NSS
YOU MEAN NSSTREAM
NSSt
YOU MEAN NSSTREAM
NSStr
YOU MEAN NSSTREAM

I HAVE LITERALLY NEVER MEANT NSSTREAM

Kallikrates
Jul 7, 2002
Pro Lurker
I think someone at apple read texts from XCode.

Small White Dragon
Nov 23, 2007

No relation.

Kallikrates posted:

I think someone at apple read texts from XCode.
Did they fix some of this?

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

pokeyman posted:

They are indeed hosting content for IAP.

Ummmm how does that work exactly? Did I miss some announcement? None of the docs or guides say anything about this that I could find, nor does SKProduct give you a URL to access the content.


Localization pro tip #47: You can use additional string files and they can live init your docs directory or elsewhere. Just create a bundle (.bundle folder) and put the custom .strings file in it, then add the localizations which will create the language folders inside the bundle. Then you can load the bundle by path and call localizedStringForKey:value:table, where table is the name of the .strings file.

This doesn't end up working for me because I need to combine strings from several different downloads in a way that I don't always know what download it came from but for some apps this approach could work.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Ender.uNF posted:

Ummmm how does that work exactly? Did I miss some announcement? None of the docs or guides say anything about this that I could find, nor does SKProduct give you a URL to access the content.

Check the API diffs for StoreKit.

Built 4 Cuban Linux
Jul 15, 2007

i own america

Kallikrates posted:

I think someone at apple read texts from XCode.

First listed change to Xcode 4.5

Built 4 Cuban Linux fucked around with this message at 03:20 on Jun 14, 2012

Kallikrates
Jul 7, 2002
Pro Lurker

Built 4 Cuban Linux posted:

First listed change to Xcode 4.5
Held a memorial for NSStream usage in the office.

Kallikrates
Jul 7, 2002
Pro Lurker
.

duck monster
Dec 15, 2004

I'm toying with the idea of rejecting any job offer that involves maps. Seemingly every client I've ever done map work for gives me no end of hell constantly crying about maps not displaying certain addresses because google wont accept "Near the deli down the road" or other badly formed addresses. I' trying every trick in the book to do this, but at the end of the day, if Google cant fix rural address finding, these jobs generate way too many support calls for my comfort.

Adbot
ADBOT LOVES YOU

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

pokeyman posted:

Check the API diffs for StoreKit.

drat... I might abandon Urban Airship then. That was the only reason I didn't roll my own store.

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