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
Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Dr. Glasscock posted:

How fast did the tickets go last year? Wasn't it a week or something? I'm trying to get my employer to send me this year. Never been, would be awesome.

Yeah, somewhere between 8 and 12 days, if my poor memory serves me. Hopefully I will be going as well.

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Dr. Glasscock posted:

drat, turns out my employer was definitely gonna send me. Nobody thought it would sell out in 6 - 12 hours. I figured it would be a day at least. :(. Next year I guess.

Same boat. Got approval to go lat night, went to reg. this AM, and :cry:

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

UncleGuito posted:

I'm not sure if this is the right thread for this, but here we go:

Does anyone have any experience with website coding for iPad? I'm trying to optimize my site for iPad viewing, but since positioning/overflows are messed in mobile safari, my sidebar only extends down the length of the screen (then ends, resulting in a white space if the user scrolls below that area). I've tried fixing it by using fixed positioning, but the user must then use two-finger scrolling in order to navigate downwards (which is kind of a pain).

If nobody answers here, the Web Design / Development thread deals with questions like this fairly regularly, FYI. Regardless, you'll need to post a URL or CSS / HTML for anyone to be able to help.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

modig posted:

http://paulpeelen.com/2010/10/01/programming-in-xcode-iphone-ios4-hello-world-tutorial/

My current serious confusion: I'm trying to figure out how to work with streaming video and do some extremely simple live processing. Apple provides this example "function"
http://developer.apple.com/library/...0010188-CH2-SW4
But isn't that not a function. I thought functions had names like ImAFunctionAndITakeArg1:Arg2: etc. When I paste that into a class I can't get it to compile even after adding what seems like appropriate headers. I'm sure the answer involves me being dumb, but I'd like to hear it.

To only answer part of your question: for some things / frameworks, they use straight C.

EDIT: curse you Ender.UNF

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
UISplitView question time!

I have a split view, all is well. When the user does something in the detail (right) side, I change both viewControllers of the split view a la:

code:
//in my UISplitViewController subclass

// make an instance of SomeViewController
// make an instance of AnotherViewController
self.viewControllers = [NSArray arrayWithObjects: someVC, anotherVC, nil];
self.delegate = anotherVC;
The views change as expected. However, if I'm in portrait mode, I don't get the popover button that's created from splitViewController:willHideViewController:withBarButtonItem:forPopoverController: when the new views appear. If I rotate to landscape and back, it behaves as expected.

Is there a way to force the 'willHide' business when switching out view controllers in a split view? If not, how would I go about manually re-creating it?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

pokeyman posted:

Just to be clear, you don't receive the ...willHide... message at all? Or does it not come with a bar button item? Assuming the former, are you sure that you have the correct delegate assigned before you change the view controllers?

You may be able to get the split view controller to re-send the message by sending it didRotateFromInterfaceOrientation:. But I'd consider that a workaround for a bug which you should file if you can't find any other way to get a new bar button item after changing the master view controller.

Correct, I do not recieve it at all (until I physically rotate.) Since it behaves as expected every time after the initial change, the delegate is set properly. I'll give your workaround a whirl, thanks for the suggestion.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
I'm working on a app with another developer, using hg as our source control. The one problem we're having is when we add files or groups. Is it possible to have files and groups somebody else added show up in the project? It's annoying to have to do a pull / update then manually drag new files into the project, and it would be wonderful to have them groups the same in both environments. Obviously it's not a huge deal, but it would be nice to have one less hoop to jump through.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
I have a conceptual question: The app I am working on shows a list of video mail messages. The messages (video files) are being downloaded in the background and I want to provide an activity indicator to the user, preferably a UIProgressView. I know how to do this in a "normal" view, so tying the progress bar to the DL isn't the problem, it's how do I deal with this in a table view? Do I make a single UIProgressBar and hang onto it in the class, and add it to the cell view of the appropriate cell (but then what happens if / when I reuse that cell?) Do I give every cell a progress bar, and only show it in the appropriate cell? If so, how do I handle it's delegate as it pops in and out of existence on scroll?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Ender.uNF posted:

I basically do this exact thing in Storm Sim. There will be some number (eg: 8) created by the table view at any one time and they will always exist. Have the progress reported to your controller as the delegate. The UIProgressView itself doesn't need a delegate, it just has a progress property.

When you hit cell for index path hide the progress view if there is no progress, otherwise show it and set it to the current progress value you have stored.

Whenever the delegate fires on your controller, check that the cell currently exists for the indexPath. If it comes back nil, that progress view isn't visible and you can ignore the value (or store it in the controller if you can't dynamically get it from your model).

If it does exist, you can get progress view and update the value right there.

Perfect, thanks a ton for the insight.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Doc Block posted:

Ugh, had what I thought was a great idea for an app, but checking the app store it seems there are already a bunch of apps with similar functionality.

I might still do it, since a lot of the other apps look pretty terrible, but :mad:

So much for me thinking of myself as a clever guy...

Ideas are a dime a dozen. Great execution is the difference maker.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Forgive the attachment, but I can't describe this in any other way, and I can't figure out how to :google: for this.

The top is my app almost ready to rock... the only thing left to do is drag the UISplitView delegate outlet to the right side ViewController (which supports UISplitViewDelegate) so it can handle rotation. I do that, and when I launch, I see the bottom.

I'm sure I'm doing something dumb... but what?

EDIT With "fix": After pulling my hair out all afternoon, I started doing stupid things, and one worked. In the MainWindoe-iPad.xib file, I clicked on the left side Navigation Controller item. In the Attributes Inspector, I un-checked then re-checked 'Shows Navigation Bar' and 'Shows Toolbar' and now it works as expected. :ms: ??

Only registered members can see post attachments!

Lumpy fucked around with this message at 00:00 on May 10, 2011

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Another iPad question! I'm porting an iPhone app to be universal, and the root view controller is the Master (left) VC in the split view controller. On app launch, the app sees if a user is logged in, and if not, displays a modal login window. in the iPhone and iPad - Landscape mode, works like a charm. However, on the iPad in portrait mode, nothing. I'm guessing since the master view isn't being displayed, it can't show the modal window? Any suggestions on either getting that modal to display, or am I going to have to scrap what I have?

:argh:

I made a method in my app delegate to show the modal, but still nothing. WHY???

code:
// in MyAppDelegate
- (void)showLoginWindow:(LoginViewController *)loggy
{

    NSLog(@"my root viewcontroller is: %@ and loggy is %@", self.window.rootViewController, loggy);
    // above shows what I expect

    // [self.window.rootViewController presentModalViewController:loggy animated:YES];
    //above works in iPhone and iPad landscape.

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 
        UISplitViewController *splitty = (UISplitViewController *)self.splitView;
        NSLog(@"Splitty is %@", splitty); 
        [splitty presentModalViewController:loggy animated:YES];
        // above works fine in landscape
    } else {
        [self.window.rootViewController presentModalViewController:loggy animated:YES];
    }
}
How on earth can you present a modal view controller in a UISplitviewController on launch??????

Lumpy fucked around with this message at 02:42 on May 12, 2011

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Double checking something I am 99.999998% positive of: I have a client who I am building an app for, who does not won a computer, only an iPad. When I generate an Ad Hoc build .ipa file, there is no way to install this on a device w/o using a computer and iTunes, right? (I know it's possible w/ jailbreaking and whatnot, but his device isn't jailbroken, nor do I wish to go down that path.)


Given that without a machine of his own, he'd have to hook his iPad up to a friend's computer, which would then sync his device to that machine upon installing the app, which is also not desirable, so the best solution is probably for him to buy a cheap-rear end netbook or something?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

OHIO posted:

Good stuff


Inevitable Ross posted:

More good stuff

Thank you guys for the info. I think I'll use the one that has the colossal jerk seal of approval.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Ender.uNF posted:

Anyone used an html page and web view for their app help file? I can muddle my way through design but I'm really just looking for a product, template, or whatever that will make it easier to create a page that doesn't look like absolute dog-crap. I've been scouring template sites but can't find anything suitable so far.

Simple is good. Send me your HTML and I'll make it purdy for you, since you've answered many questions of mine here.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Mighty Zoltar posted:

Hopefully i have an easy question. Not being a developer yet, i dont appear to be able to find an answer to my question anywhere else thus far.

Is it possible to use a web link to open an app on the iphone/ipad. That is, either go to a website to open the app, and better yet, create a shortcut to it. If thstbis possible, can it be taken a step further and open an app in a specific state? For example, you click on an app link and the store opens on the right page. I'd like a certain file/whatever to open in an app.

Short version - can i create hyperlinks that would open something like goodreader with a specific document opened within it?

Thanks in advance.

Yes, you can have your app launched with a custom url scheme (something like someApp://blah) and you can parse that URL to obtain information / do different things on launch based on it.

Google 'iphone sdk custom url scheme' for lots and lots of info / examples, etc.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

stray posted:

Why is it so hard to find some decent sample code that shows you how to build an app in Xcode 4 that uses a UITabBarController at its root, where one of the tabs gives you a UINavigationController that lets you drill down from a UITableView to a UIView?

I mean, that's got to be one of the most common development scenarios, right? All I could find were a couple of videos, but one is from Xcode 3 and the other shows the guy dragging a nav controller into the tab bar's nib, then pointing it at a totally empty view. For example, when the nav controller is the root view, I know how to change the tab bar's color, but how would I change the color of the nav controller in that example? It kind of cuts off right before the most crucial step.

I just did this on Monday. I am on my phone right now, but I will make a sample project and a quick step by step when I get home in 8 hours or so. I had some trouble at first, but I was making it far too hard, it turned out to be one of those "oh, duh!" things.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

stray posted:

Why is it so hard to find some decent sample code that shows you how to build an app in Xcode 4 that uses a UITabBarController at its root, where one of the tabs gives you a UINavigationController that lets you drill down from a UITableView to a UIView?

I mean, that's got to be one of the most common development scenarios, right? All I could find were a couple of videos, but one is from Xcode 3 and the other shows the guy dragging a nav controller into the tab bar's nib, then pointing it at a totally empty view. For example, when the nav controller is the root view, I know how to change the tab bar's color, but how would I change the color of the nav controller in that example? It kind of cuts off right before the most crucial step.

Sorry for the delay, I blame my kid. :colbert:

Sample project is up here: https://bitbucket.org/veddermatic/navitab/overview

But here's the step by step, which is so simple, I was able to figure it out!



  • Create new project from Tab Bar Application template.
  • Add new Class to your project that is a UITableViewController delegate (right click->New File -> UIViewController template -> pick Sublcass of: UITableViewController) Name it 'NavigationRoot' or something
  • Click on MainWindow.xib, and get into the expanded left view so you can drill down into things.
  • Expand the Tab Bar Controller so you can see the Tab Bar and the two View Controller objects in there (First View Controller and Second View Controller)
  • From the Library, drag in a Navigation Controller and nest it inside the Tab Bar Controller in-between the existing ones or before or after them: choose your own adventure! (you can delete either or both of the "stock" ones if you want.)
  • You will see a second view looking thing pop up in your editor. Do not panic, this is fine.
  • Expand the NAvigation Controller you just added
  • Click on the View Controller - Root View Controller, and in the inspector, change the class to NavigationRoot.
  • Edit your NavigationRoot.m file to give your table a row with some witty text.
  • Run your project in the simulator. Hooray!
  • Add another view controller, and edit your NavigationRoot.m to push it when you select your witty text row. (I am glossing over this step since I'm guessing you know how to do it.)
  • Run your project again!
  • Enjoy!

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Kekekela posted:

Thanks! God why didn't I get this excited for classes when I was actually in school...

Probably the same reason I didn't. Beer and college girls.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Kekekela posted:

Has anyone worked through assignment two of the current CS193p class?

I'm kind of confused conceptually on several things relating to the RPN calculator in general and the entry of variables as well.

Where do you get the assignments? I am on lecture 13, but I'd love to do the homework. I assume it's somewhere obvious and I am am blind.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Core Data Question:

I'm syncing data with a server: I want to create new managed objects if they don't exist, and update ones if the modified date for the entity on the server is newer than the one on the device. I've read through this: http://developer.apple.com/library/.../TP40003174-SW1

Since I dont' have any relationship data here, it seems that their suggestion to "..create managed objects for the entire set and weed out (delete) any duplicates before save using a single large IN predicate" would be appropriate for adding new people. Question is, how do I do that? how do I then get the duplicates and update based on that timestamp?

Core Data baffles me.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Ender.uNF posted:

Well F-me, I just accidentally refreshed and lost a huge reply I wrote up... but basically they tell you how to do this in the article you linked. You just need to identify what your key field(s) are... in their example, they are using employeeID. The fact that the DB results and server results are both sorted in order allows you to use two indexes with a loop and walk forward, increasing the db list index only if the matching record is found in the server list, otherwise add a new record to the context and continue with the next pass until you reach the end of the server list. You just need to compare the dates as you go. If you can provide more detail I might be able to offer more help.


You can also check out http://restkit.org/. I haven't used it yet but it is supposed to be able to grab stuff from a REST web service and stuff it into CoreData (using it as an offline cache and updating as appropriate).

Thanks for the reply. I saw their looping structure, but that comment I quoted from the article made is seem like there was a Magic Line of Code™ where I set a single predicate on my new objects and when I save, dupes dont' happen.

I'll probably take you up on your offer of more detail when i get closer to implementation, righ tnow just thinking through it all.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Question about filtering an array on multiple criteria / parameters. Say I have an array of objects (returned form a Core Data fetch request, if that matters) with the properties name, color, hatSize and I am displaying them in a UITableView to the user.

If I let the user filter by color, that's simple: poop out a filtered array:

code:
NSPredicate *p = [NSPredicate predicateWithFormat:@"color == %@", userColor];
self.tableDataArray = [allItems filteredArrayWithPredicate:p];
...
Now if I want to add in filtering by hatSize as well, I have to keep track of if I filtered by color already to see if I need to only filter on allItems or on the previously filtered result. If I then add in filtering by name as well, I have to keep track of if I filtered by either of the other two and so on.

I'm sure this is a problem / pattern that's been done a billion times but I can't :google: the right terms, and I'm too dumb to see what will be the very obvious solution when someone takes pity on me and points it out.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Gordon Cole posted:

How about keeping an array of predicates and adding/removing them as the user adds or removes filters? Then just apply all of the predicates to generate your filtered array. It would probably be more efficient to store a list of conditions and create a single predicate that includes all of them, actually.

Thanks. I don't know how I missed NSCompoundPredicate while reading up on this, but your post made the light-bulb go on.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Core Data question: I read the guides but there are so many :words: my brain hurts, so I just want confirmation on something that I think is right.

Say I fetch a list of managed objects, show them to the user. User taps on a row and I move to a detail screen, passing a reference to the object anObject associated with the row they tapped. On this screen the user can edit some property; say name

They then press a button move to the next screen, again, passing a reference to anObject, and here the user could edit some other property if they wanted, but instead, they hit the 'cancel' button, which should un-do any changes to anObject and zip them back to the list.


Since I have not saved the context, no changes were made to the local store, so I should do:
code:
[myContext refreshObject:anObject mergeChanges:NO];


and then I can release my reference to anObject and all is well.

I cannot do
code:
[myContext deleteObject:anObject];


Because the list screen still is showing it, yes?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
I am going insane. Why won't my modal UIImagePicker go away?

code:

- (void)removeCameraView:(NSNotification *)notify
{
    logger(@"called!!!!");
    [self dismissModalViewControllerAnimated:NO];
    self.cameraView = nil;
    logger(@"there better not be a camera when I get back...");
}

- (void)viewDidLoad
{
    
    [super viewDidLoad];
   
    [[NSNotificationCenter defaultCenter] addObserver:self 
    selector:@selector(removeCameraView:) 
    name:UIApplicationWillResignActiveNotification 
    object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self 
    selector:@selector(removeCameraView:) 
    name:UIApplicationDidEnterBackgroundNotification 
    object:nil];
}

- (void) viewWillDisappear:(BOOL)animated
{
    [self removeCameraView:nil];
    [super viewWillDisappear:animated];
}

- (void)viewDidUnload {
    [[NSNotificationCenter defaultCenter] 
    removeObserver:self 
    name:UIApplicationWillResignActiveNotification 
    object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self 
    name:UIApplicationDidEnterBackgroundNotification 
    object:nil];
    [super viewDidUnload];
}
I bring up the modal UIImagePicker, then hit the home button.... I see the trace from my removeCameraView call.... but when I come back, the UIImagePicker is still there.

EDIT OK, I "solved" it, but I still have no clue why this works, but my orignal attempt doesn't. In ApplicationDelegate:

code:
- (void)applicationWillResignActive:(UIApplication *)application
{
    [_navController dismissModalViewControllerAnimated:NO];
}
Dismisses it.... if anyone can learn me the why, I would be grateful.

Lumpy fucked around with this message at 22:01 on Mar 13, 2012

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Zhentar posted:

It might help if you included how you present the UIImagePicker.

Sorry:

code:
        UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
        imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
        imagePicker.mediaTypes = [NSArray arrayWithObjects: (NSString *) kUTTypeImage, nil];
        imagePicker.allowsEditing = NO;
        imagePicker.delegate = self;
        self.cameraView = imagePicker;
        [self presentModalViewController:imagePicker animated:YES];
Just basic vanilla modal. I'm hanging onto a pointer to it because I want to change the overlay view on rotation (which is another fun headache!)

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

duck monster posted:

Apple needs to integrate mercurial in. Its basically git for dumb people like me.

We use Mercurial at work for iOS dev (and everything else now) and it's absolutely lovely.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Is there a way to have apple remove bad reviews? Apparently, Anderson Cooper mentioned an app with a similar name to one of mine on his show today, and people are buying mine, then giving it a one star review because it doesn't do whatever the heck the app he showed / talked about on his show did.

Anyone have any experience with that sort of thing?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Ender.uNF posted:

hosed. Edit your description and update notes to point out that you are a different app and ask people to stop giving you 1-star reviews. Or pull your app from the store for a few days.

Edit: also write the Anderson Cooper show. It is just slightly possible that a producer might feel sorry for you and they might make a correction. Unlikely but might as well ask.

Hooray.

Since my app is old, my screenshots are 320x480, which is no longer acceptable, so I can't edit my description quick.... :sigh:

The good news is, if only a small percentage of people ask for refunds, I made a lot of money today.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
So if you were about to start on a Cocos2D based game in the next month, would you use version 2, or still stick with 1.0.1?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
EDIT: Hit post and saw I had a typo in my source... thanks thread!! :v:

EDIT 2: I had posted a "why the hell isn't my image showing upp???" question.. turns out it's because I typoed the file name. What's odd is that it was working fine in the simulator. My image was named Landscape.png and my define was:

code:
#define L_IMG_NAME @"LandScape.png"
Note the capital 's' in scape. The simulator had no problem showing me the image, but the device didn't (which is what I would have expected!) So watch out for that crazyness!!

Lumpy fucked around with this message at 18:16 on Apr 27, 2012

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
I am trying to put a Movie player on the screen centered horizontally (equal space left and right), that *stays* centered when I rotate the device. My thought process is: figure out where to put movie view, put it there, set auto-resizing masks to flexible left and right margins.

Objective-C code:
MPMoviePlayerController *aMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:
        [NSURL fileURLWithPath:url]];
self.moviePlayer = aMoviePlayer;
[_moviePlayer prepareToPlay];
CGFloat vidX = (currentOrientation == UIInterfaceOrientationPortrait || 
               currentOrientation == UIInterfaceOrientationPortraitUpsideDown) ? 
               VIDEO_PLAYER_XPOS_PORT :  // 143.0
               VIDEO_PLAYER_XPOS_LAND;  // 272.0
logger(@"putting video at X: %f", vidX);
_moviePlayer.view.frame = CGRectMake(vidX, VIDEO_PLAYER_YPOS, VIDEO_PLAYER_WIDTH, VIDEO_PLAYER_HEIGHT);
_moviePlayer.view.autoresizingMask =  UIViewAutoresizingFlexibleLeftMargin |
         UIViewAutoresizingFlexibleRightMargin | 
         UIViewAutoresizingFlexibleBottomMargin;
[self.view addSubview:_moviePlayer.view];
logger(@"OH HAY I AM MOVIE PLAYER AND I AM AT X: %f", _moviePlayer.view.frame.origin.x);
Doing this puts the movie very close to the left edge of the parent view, despite both log statements giving the expected value. Removing the UIViewAutoresizingFlexibleLeftMargin from the auto resize mask puts the view where I expect it, but then does not center it on rotation.

Should I give up and just move the view manually in a rotation handler, or am I doing something stupid?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Having never done sotryboards yet (new things scare me!) I have a question about handling transitioning to views works. I have an app with a "main screen" and you can select an item from several categories, and you go to a details screen for the item. The item has a relationship to other items that is shown on the detail screen that they can tap on to view details on *that* item, which may or may not be in the same category. If it's in the same category, I can just stay on the same view controller and swap out the item. If it's in a different category, I need to bring up a different kind of view controller. Since the user can in theory do an "endless" chain of views (picks an item of type A, then on it's details screen picks item of type B, then on the new details screen picks item of type C, then picks item of type B, etc.) I want to avoid a UINavigationController since I could get hundres of views on the stack.

So, my question is if I have transitions / segues to these new views without a UINavigationController, will they "replace" one another, or will I be building up a huge stack of view controllers if the user follows a chain of 100 items?

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/

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Built 4 Cuban Linux posted:

Yeah, I was fine with them being part of a view controller, the problem was just interface builder forcing you to design within that 480x320 window. Oh well! Thanks, I may throw some nibs in

You can set the view to 'freeform' in the inspector and you can resize it willy nilly. Alternately, you can trash the stock view your XIB gets created with and drag in a new UIView and it will be set to freeform by default. Just remember to hook up the file's owners view outlet to the new one if you do it that way.

Lumpy fucked around with this message at 05:11 on Aug 2, 2012

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
Core Data question:

I have an abstract entity 'Foo'. I have, for sake of example, two other entities 'Bar' and 'Baz' that have Foo as their parent entity. Bar has a 'title' property, and 'Baz' has 'firstName' and 'lastName' properties.

In a magical, perfect world, I'd like to performa a fetch request with the entity description being 'Foo' and then some predicate along the lines of "title BEGINSWITH[c] %@ OR firstName BEGINSWITH[c] %@ OR lastName BEGINSWITH[c] %@", someString But since Foo does not have those properties, it obviously fails with a valueForUndefinedKey error.

Since I'm on iOS with a SQLite data store, I can't do a predicate with block on the fetch request, so the two kludgy solutions I've thought of are adding a 'searchName' property to Foo, and setting when I set the name of Bar and lastName of Baz, but then I lose searching by firstName, unless I add a searchName2 etc. and that's ugly. The other is to just get everything in the initial fetch request and filter that with a block predicate, but I'd like to avoid that for performance reasons.

Anyone solve this problem better than my initial stabs at it?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

pokeyman posted:

Have you actually run into performance problems, or are you assuming filtering one big fetch request will be slower? How many objects are we talking about?

Does this need to be a single fetch request? Why not do one for Bar matching title, another for Baz matching firstName or lastName, then iterate over both of them?

The reality of the situation is that there are 5 different entities, and there will be thousands, possibly tens of thousands of them. I am probably prematurely optimizing; as that is one of my bad habits, and I implemented it as a 'fetch all and filter w/ block predicate' today, but haven't gotten to generating 1, 10, 100 thousands records to see how it performs versus doing 5 different ones and merging the results after. Thanks for that suggestion, by the way... for some reason that never occurred to me :D

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Ender.uNF posted:


// good stuff


Thanks for all that.

Just for an FYI to anyone who cares, I wrote a test app and starting at 1,000 records going up to ~35,000 doing multiple fetch requests and merging / sorting the results was twice as fast as one big fetch and filtering it. Both are fast though....


code:
total records was 35964

single fetch and filter results got 3996 results
test took 0.351054

multiple fetch and merge got 3996 results
test took 0.173736

Adbot
ADBOT LOVES YOU

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Ender.uNF posted:

I'm assuming you tested this on the device and not in the simulator.

Yes. Although I think my first-gen Core 2 Duo Mac mini might be slower than the iPad 3 I tested on.... =)

And thanks again for your reply, I'm changing my model today to move those properties to the base entity and having transient ones point to them.

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