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
Paolomania
Apr 26, 2006

PT6A posted:

If they feel that you're not adding anything to the user experience over a website, then they might reject it on that basis. Nothing seems particularly bad about that storyboard, but at the same time it seems like you aren't really getting any utility out of making a native iOS app over making a website.

Even if the data is all local? Those webviews don't actually hit the network.

Adbot
ADBOT LOVES YOU

PT6A
Jan 5, 2006

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

Paolomania posted:

Even if the data is all local? Those webviews don't actually hit the network.

Especially in that case. I don't see any way to edit data, so you essentially have a book with a fancy hierarchy. Is there a specific reason you're not publishing this as an eBook? At least add some cool features like a way to scale recipe amounts up and down, or something that makes it more than just a collection of information. Even then, without the ability for the user to actually extend the information by (for example) entering their own recipes, they might feel it's not worthy of being on the App Store. Have you seen any apps with similar functionality and layout available on the App Store?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

xpander posted:

Last weekend I finished the Big Nerd Ranch iOS book, and am about to undertake my first app. One thing that a few Internet articles recommended was to create your interfaces by hand programmatically, to really learn what's going on under the hood. I've also read that you should just use Interface Builder because it owns, and dive deeper once you've got some experience under your belt. Does anyone in here have any particular opinions on this topic?

This is an ongoing debate and has been for decades. Pick one and keep working on your project. Try the other one if you do get bogged down. It's easy to mix and match code-only and IB so you can't go wrong.

lord funk
Feb 16, 2004

pokeyman posted:

This is an ongoing debate and has been for decades. Pick one and keep working on your project. Try the other one if you do get bogged down. It's easy to mix and match code-only and IB so you can't go wrong.

When I started it actually bothered me that you had to still use code if you choose to use IB, since not all the view properties are represented there. So I shunned IB and did everything in code.

That was before storyboards. Now IB is just so much more useful I think it would be silly to ignore it for new projects. Sure, you will still touch up your views with code, but the view controller switching alone is worth using IB.

xpander
Sep 2, 2004
Thanks for the input guys, my thoughts mirror yours. I love IB, so that's what I'm gonna use!

tarepanda
Mar 26, 2011

Living the Dream

lord funk posted:

When I started it actually bothered me that you had to still use code if you choose to use IB, since not all the view properties are represented there. So I shunned IB and did everything in code.

That was before storyboards. Now IB is just so much more useful I think it would be silly to ignore it for new projects. Sure, you will still touch up your views with code, but the view controller switching alone is worth using IB.

loving autolayout.

It takes me forever to get things tweaked in IB using autolayout since moving one thing seems to change everything else I set there. Or if I pin the height on a button, moving it or changing the text seems to remove the pin andasodas

lord funk
Feb 16, 2004

tarepanda posted:

loving autolayout.
Yeah, good point. I disable it, and don't plan to use it until they fix all the nasty behavour.

tarepanda
Mar 26, 2011

Living the Dream

lord funk posted:

Yeah, good point. I disable it, and don't plan to use it until they fix all the nasty behavour.

That's what I'd do if it were an option... for example, if I could just make a different storyboard for the iPhone 5. :[

Toady
Jan 12, 2009

I just got used to how Auto Layout behaves in IB, so it doesn't bother me like it used to. It's just too convenient to pass up when I can make complex split view resizing behaviors using no code.

Paolomania
Apr 26, 2006

PT6A posted:

Especially in that case. I don't see any way to edit data, so you essentially have a book with a fancy hierarchy. Is there a specific reason you're not publishing this as an eBook? At least add some cool features like a way to scale recipe amounts up and down, or something that makes it more than just a collection of information. Even then, without the ability for the user to actually extend the information by (for example) entering their own recipes, they might feel it's not worthy of being on the App Store. Have you seen any apps with similar functionality and layout available on the App Store?

It is an iPhone version of a friend's Android app. I pretty much did a direct conversion of his android UI to native iOS controls. I guess I need to let him know that Apple wants more interesting functionality if he wants his app up there.

tarepanda
Mar 26, 2011

Living the Dream
It's been a while, but Apple pretty much specifically prohibits book-like apps somewhere in the guidelines.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Well... Apparently Urban Airship is dumping their IAP platform as of July 1st.

But hey, just use Apple's hosted content* :v:



*So long as you can require iOS 6, and it doesn't support free content, and after the shutdown you'll have to have your own web service to serve extra data not included in the iTC records.

Yodzilla
Apr 29, 2005

Now who looks even dumber?

Beef Witch
So all UA is doing is push notifications from now on? That seems really goddamn odd. Did Apple change something to push them in to this or is this purely a business decision?

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

Yodzilla posted:

So all UA is doing is push notifications from now on? That seems really goddamn odd. Did Apple change something to push them in to this or is this purely a business decision?

As far as I can tell, they are focusing on push messages with marketing being the focus. I'm pretty sure they are soaking their huge customers and that makes all us small potatoes nothing but a distraction.

lmao zebong
Nov 25, 2006

NBA All-Injury First Team
I'm trying to display an image in a UITableViewCell and I'm running into a bit of an issue. I have an array called Articles of dictionary objects, get the image URL from each dictionary, and then create a UIImage from that and then display it in the cell. However, the image isn't displaying for me.

Here is my code, this is all in tableView:cellForRowAtIndexPath:
code:
NSDictionary *article = [articles objectAtIndex:indexPath.row];
NSString *imageURL = [article objectForKey:@"image_url"];
NSURL *url = [NSURL URLWithString:[imageURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSData *imageData = [[NSData alloc] initWithContentsOfURL:url];

CGRect imageFrame = CGRectMake(2, 20, 75, 125);
        
UIImageView *articleImage = [[UIImageView alloc] initWithFrame:imageFrame];
articleImage.image = [[UIImage alloc] initWithData:imageData];

[[cell contentView] addSubview:articleImage];
For some reason this isn't working. I've made another single view project and the images are loading fine, and if I have a picture saved into the project and load that image into articleImage there is no issue. Any ideas?

lmao zebong fucked around with this message at 03:21 on Feb 10, 2013

Hog Obituary
Jun 11, 2006
start the day right

lmao zebong posted:

I'm trying to display an image in a UITableViewCell and I'm running into a bit of an issue. I have an array called Articles of dictionary objects, get the image URL from each dictionary, and then create a UIImage from that and then display it in the cell. However, the image isn't displaying for me.
I don't have an answer for why this isn't working specifically, but in general this approach is a bit unsafe. I imagine this code is in cellForRowAtIndexPath, right?

I believe [[NSData alloc] initWithContentsOfURL:url] is going to block until all the data is downloaded, you really don't want that in your tableview rendering code, especially on the UI thread. (I'm assuming the images are remote here). Consider using SDImageView SDWebImage or something for remote/async images.

But also, you can start debugging by replacing [[NSData alloc] initWithContentsOfURL:url] with "initWithContentsOfFile" and using a local file just to see what happens.

Hog Obituary fucked around with this message at 03:58 on Feb 10, 2013

lmao zebong
Nov 25, 2006

NBA All-Injury First Team
You're right, looks like that's the case. Changing [[NSData alloc] initWithContentsOfURL:url] to initWithContentsOfFile loaded the image, so I'll have to load all the images first before rendering the table. Thanks for the point in the right direction.

Doc Block
Apr 15, 2003
Fun Shoe
Why do you have to load all the images first? If they're being downloaded over the network, just download them asynchronously in a background thread as-needed and then stuff them in the appropriate imageView when done. If you don't want to write the code yourself, use something like AFNetworking's UIImageView+AFNetworking category to do it for you.

Hog Obituary
Jun 11, 2006
start the day right

lmao zebong posted:

You're right, looks like that's the case. Changing [[NSData alloc] initWithContentsOfURL:url] to initWithContentsOfFile loaded the image, so I'll have to load all the images first before rendering the table. Thanks for the point in the right direction.

Well, you can replace the image with an ActivityIndicator while it is loading. You'll want to cache your images and load them on demand. Look into SDWebImage: https://github.com/rs/SDWebImage

e: yeah, or what Doc Block said. In any case, this is a near-solved problem and there are probably numerous examples of a scrollable UITableView with remotely loaded images.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
AFNetworking is the poo poo. Read the code and you'll learn something.

lmao zebong
Nov 25, 2006

NBA All-Injury First Team
Thanks for the links, I can see where I was going wrong here and those examples help a lot.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Aside from rolling my own, anyone have any suggestions for a multicolumn UITableView/Cell? It'd be cool if I didn't have to reinvent the wheel here. Thank you.

*edit* Well hello CollectionView. Haven't used this yet :ohdear:

Doh004 fucked around with this message at 17:13 on Feb 11, 2013

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

pokeyman posted:

AFNetworking is the poo poo. Read the code and you'll learn something.

So has AFNetworking essentially become the new ASIHTTPRequest?

Doctor w-rw-rw-
Jun 24, 2008

ultramiraculous posted:

So has AFNetworking essentially become the new ASIHTTPRequest?

Yes. Stop using ASI; it's outdated.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Doh004 posted:

Aside from rolling my own, anyone have any suggestions for a multicolumn UITableView/Cell? It'd be cool if I didn't have to reinvent the wheel here. Thank you.

*edit* Well hello CollectionView. Haven't used this yet :ohdear:

CollectionView is probably your answer, but I've used GMGridView in the past and it has worked well.

https://github.com/gmoledina/GMGridView

LP0 ON FIRE
Jan 25, 2006

beep boop
I want to use GNU sed in Xcode, so I just installed GNU sed in OS X following these instructions:

http://solarianprogrammer.com/2012/03/07/starting-gnu-sed-mac-osx/

I'm not sure exactly how this stuff works, but one of the last steps shows how to "add it to the shell path". Note this is Terminal, but in order to use it, does export PATH=/usr/sed-4.2/bin:$PATH have to be in Xcode's Run Script? What do I change the Shell text field to in order to use this?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
I cannot find anything via google, so once again, I turn to you kind folks. In an iOS app, I write data to a file in the Documents directory. It does so, and I can read the data back out later in the app. Hooray!

I then install a newer version of the application (downloading via Enterprise deployment) "on top of" yesterday's build. I get to the screen where I read the data file previously written and:

C code:
NSUnderlyingError = 
"Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn't be completed. No such file or directory\"";
I have the device plugged in and am looking at the Documents directory in the Organizer, and I'm staring at the file. The app is reading other files from that directory as well. Has anyone run into anything similar?

Doc Block
Apr 15, 2003
Fun Shoe

LP0 ON FIRE posted:

I want to use GNU sed in Xcode, so I just installed GNU sed in OS X following these instructions:

http://solarianprogrammer.com/2012/03/07/starting-gnu-sed-mac-osx/

I'm not sure exactly how this stuff works, but one of the last steps shows how to "add it to the shell path". Note this is Terminal, but in order to use it, does export PATH=/usr/sed-4.2/bin:$PATH have to be in Xcode's Run Script? What do I change the Shell text field to in order to use this?

Leave the Shell text field as /bin/sh. Just have
code:
PATH=/usr/sed-4.2/bin:$PATH
as the first line of the run script. Leave out the export part of the path statement.

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

Lumpy posted:

I cannot find anything via google, so once again, I turn to you kind folks. In an iOS app, I write data to a file in the Documents directory. It does so, and I can read the data back out later in the app. Hooray!

I then install a newer version of the application (downloading via Enterprise deployment) "on top of" yesterday's build. I get to the screen where I read the data file previously written and:

C code:
NSUnderlyingError = 
"Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn't be completed. No such file or directory\"";
I have the device plugged in and am looking at the Documents directory in the Organizer, and I'm staring at the file. The app is reading other files from that directory as well. Has anyone run into anything similar?

Probably not your issue but I ran into a problem storing paths, as updates are installed in a new directory and the data copied over. My old stored paths no longer pointed to anything; I fixed it by using relative paths.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Glimm posted:

CollectionView is probably your answer, but I've used GMGridView in the past and it has worked well.

https://github.com/gmoledina/GMGridView

Is it a no-no to have a UITableView, and then add a UICollectionView to a cell? Sadly the entire controller that I'm building isn't all a grid and it seems the collection view isn't right for everything.

LP0 ON FIRE
Jan 25, 2006

beep boop

Doc Block posted:

Leave the Shell text field as /bin/sh. Just have
code:
PATH=/usr/sed-4.2/bin:$PATH
as the first line of the run script. Leave out the export part of the path statement.

Thanks! That was it. Getting the same error I was getting when I was not using GNU sed:
code:
sed: 8: "/<tileset\s\+firstgid=" ...": unexpected EOF (pending }'s)
Command /bin/sh failed with exit code 1
I know this isn't an Objective-c question really, but I'll post it if anyone sees anything obviously wrong that's causing the error:

code:
PATH=/usr/sed-4.2/bin:$PATH

sed -n '/<tileset\s\+firstgid="1"/ {
s/\(<tileset\s\+firstgid="1"\).*/\1/p
r /Resources/maps_sideScrolling/tileProperties.txt
:loop
n
s/.*<layer name="background".*/&/p
t
b loop }' ~/Resources/maps_sideScrolling/ruinsItemCave2.tmx;

Doc Block
Apr 15, 2003
Fun Shoe
It's a shell script, so don't break a single command up across multiple lines. Each line is being executed as a separate command.

edit: you can use "\" to indicate that the next line should be part of the current one, so maybe try
code:
PATH=/usr/sed-4.2/bin:$PATH

sed -n '/<tileset\s\+firstgid="1"/ { \
s/\(<tileset\s\+firstgid="1"\).*/\1/p \
r /Resources/maps_sideScrolling/tileProperties.txt \
:loop \
n \
s/.*<layer name="background".*/&/p \
t \
b loop }' ~/Resources/maps_sideScrolling/ruinsItemCave2.tmx
if you absolutely have to break it up.

Doc Block fucked around with this message at 23:38 on Feb 11, 2013

LP0 ON FIRE
Jan 25, 2006

beep boop
I get "newline can not be used as a string delimiter" but I don't even see how the backslash is being used as a delimiter.

If I make it all one line without the backslashes I get:

sed: 1: "/<tileset\s\+firstgid=" ...": bad flag in substitute command: 'r'

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doh004 posted:

Is it a no-no to have a UITableView, and then add a UICollectionView to a cell? Sadly the entire controller that I'm building isn't all a grid and it seems the collection view isn't right for everything.

As always, try it and see what happens.

For what it's worth, collection views can do pretty much anything you like. They're the graph theory of UIKit: every problem can be solved with a collection view.

And if you need collection views on iOS 5, there's a polyfill called PSTCollectionView.

Doctor w-rw-rw-
Jun 24, 2008
So I'm getting back into iOS dev a bit in my free time, and am contributing to an app which uses a storyboard. Why do people use storyboards? What's the advantage?

It seems like a mega-nib, so it has merge issues, just opening it will change it, it's dog-slow, and it crashes Xcode much of the time. Made worse by the fact that it's a single gargantuan file rather than a number of smaller files.

Can someone enlighten me on what makes a storyboard worth it?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Ender.uNF posted:

Probably not your issue but I ran into a problem storing paths, as updates are installed in a new directory and the data copied over. My old stored paths no longer pointed to anything; I fixed it by using relative paths.

After tracing back where the file path was being generated in another team members class, this was exactly my issue.

Thanks!

lord funk
Feb 16, 2004

Doctor w-rw-rw- posted:

Can someone enlighten me on what makes a storyboard worth it?

Not writing buckets and buckets of view controller switching code. I pretty much use it for that purpose only, and build my views programatically.

tarepanda
Mar 26, 2011

Living the Dream

Doctor w-rw-rw- posted:

it crashes Xcode much of the time.

I've never once had a storyboard crash Xcode, though I've seen the other problems.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Doctor w-rw-rw- posted:

Yes. Stop using ASI; it's outdated.

It lives on in one of the projects I'm working on. I just wanted to make sure I wasn't going to back the wrong horse with AFClient.

Doctor w-rw-rw- posted:

So I'm getting back into iOS dev a bit in my free time, and am contributing to an app which uses a storyboard. Why do people use storyboards? What's the advantage?

It seems like a mega-nib, so it has merge issues, just opening it will change it, it's dog-slow, and it crashes Xcode much of the time. Made worse by the fact that it's a single gargantuan file rather than a number of smaller files.

Can someone enlighten me on what makes a storyboard worth it?

It does some fun resource management, for one thing. Unlike Xibs, where the whole tree gets built at init time, storyboards will load individual parts lazily. You can basically assemble large sections of views and their transitions in one file, with the downside being they're all in one file and XCode will try and show you all of them.

I'm also pretty sure the "changes when you open it" thing is just a symptom of an XCode upgrade. As of sometime recently they started automagically upgrading your interface files to the schema of the last version, which means your whole team doesn't have to upgrade at once but you also don't end up with XIBs from 2009 in your source tree as easily.

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doctor w-rw-rw- posted:

So I'm getting back into iOS dev a bit in my free time, and am contributing to an app which uses a storyboard. Why do people use storyboards? What's the advantage?

It seems like a mega-nib, so it has merge issues, just opening it will change it, it's dog-slow, and it crashes Xcode much of the time. Made worse by the fact that it's a single gargantuan file rather than a number of smaller files.

Can someone enlighten me on what makes a storyboard worth it?

File bugs for the crashes, that ain't right.

I think of storyboards as the next level of abstraction above nibs. A nib combines many views under one view controller; a storyboard combines many nibs under one app. They're useful for the same reason nibs are useful: they configure and instantiate many objects with a single line of code.

Unfortunately I found iPad storyboards unusable. You must zoom to 100% to edit anything, yet every view controller insists on drawing at least one view (sometimes many in the case of tab bar or navigation view controllers) at 1024x768. I couldn't meaningfully edit an iPad storyboard on a 27" display, let alone anything smaller. So I gave up.

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