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
Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Thanks, that looks like it's worth checking out. The only problem there is that it requires iTunes to view the lectures, while I only have Android devices, and I don't like the idea of installing iTunes just to watch the lectures. Oh well.

I'd love to hear book recommendations too, it's usually easier for me to follow along with something printed than with a video or audio.

Adbot
ADBOT LOVES YOU

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

Volmarias posted:

Thanks, that looks like it's worth checking out. The only problem there is that it requires iTunes to view the lectures, while I only have Android devices, and I don't like the idea of installing iTunes just to watch the lectures. Oh well.

I'd love to hear book recommendations too, it's usually easier for me to follow along with something printed than with a video or audio.

Me too but so far I haven't seen anything good book wise... It might exist, I just don't know of any.

Just install iTunes for windows in a VM. The actual videos are (IIRC) h264.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
You kinda need a Mac (or at least OS X in a VM) for iOS dev.

I didn't bother watching most of the videos; the slides and homework assignments were enough most of the time.

lord funk
Feb 16, 2004

Plorkyeran posted:

I didn't bother watching most of the videos; the slides and homework assignments were enough most of the time.

Is Paul Hegarty still teaching it? He was great, and I think worth watching for the small comments more than the main content.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Plorkyeran posted:

You kinda need a Mac (or at least OS X in a VM) for iOS dev.

I didn't bother watching most of the videos; the slides and homework assignments were enough most of the time.

Yeah, I know. I'll probably end up with an MBP or something through work, and my current job has actually given me one now. I just don't want to use a laptop to watch videos.

shodanjr_gr
Nov 20, 2007
I hosed up and accidentally deleted /usr/local/include on my Mavericks installation (don't ask how that happened please, it's shameful).

I seem to recall there being some system-default headers in there? What would be the most appropriate way to restore the file structure to the way apple intended it to be?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
The entire point of /usr/local is that the OS never puts files there.

shodanjr_gr
Nov 20, 2007
Yeah, I'm stupid. I noticed a /GL/ path there and got confused. It was something installed by myself.

Doc Block
Apr 15, 2003
Fun Shoe
Hope you've got backups. Hooray for Time Machine.

lord funk
Feb 16, 2004

Great. My dark keyboard flashes white when it's dismissed. Doesn't happen in a blank new app. Can one, just one of the UI objects work without needing some kind of troubleshooting?

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

lord funk posted:

Great. My dark keyboard flashes white when it's dismissed. Doesn't happen in a blank new app. Can one, just one of the UI objects work without needing some kind of troubleshooting?

No.

Storm Sim has a dark theme (people use it to fall asleep; no one wants to be blinded). I am discovering that doing anything other than the default white is a huge pain in the rear end. I'm now up to fighting the popovers. My background tableview is black. The popover now has no border because it just wants to dim the background, which it can't do on a black background. Is there an easy way to add a border like every other view? Nope.

lord funk
Feb 16, 2004

Have you run into this? If you use a navigation controller in a popover, there is a weird gradient that appears at the bottom of the popover the second time you pop it open. Here's the app I submitted to the Bug Reporter:

https://pantherfile.uwm.edu/kdschlei/public/GhostlyImage.zip



Of course, it's not noticeable if you use the default light background, and why would anyone not use the default? Everyone wants a bright white popover! EVERYONE!!!

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

lord funk posted:

Have you run into this? If you use a navigation controller in a popover, there is a weird gradient that appears at the bottom of the popover the second time you pop it open. Here's the app I submitted to the Bug Reporter:

Of course, it's not noticeable if you use the default light background, and why would anyone not use the default? Everyone wants a bright white popover! EVERYONE!!!

You will use ze white background und you will likes it, yes? EVERYONE LOVES ZE WHITE! COLOR ES VERBOTEN! GRADIENTS ES VERBOTEN! VERBOTEN!!!!!

I'm looking forward to that issue; currently I'm trying to figure out how I can get the popover not to blend into the background view.

kitten smoothie
Dec 29, 2001

My favorite iOS 7 WTF is if you present a UIDocumentInteractionController from a view controller that was presented modally (but only as UIModalPresentationPageSheet or UIModalPresentationFormSheet, the other non-sheet styles work just dandy).

It comes up fine, but when the document interaction controller is dismissed, it also tears off the view from the modal view controller that presented it. You just get left with the shadow view that was behind the modal, so the app is unusable beyond that point. The best thing I could come up with to work around was to temporarily dismiss the modal view controller but hang onto a reference, present the UIDocumentInteractionController from the modal's parent, and then re-present the modal upon dismissal.

They did nothing with the radar I filed three months ago, but at least it looks like it's been fixed in 7.1, thankfully.

lord funk
Feb 16, 2004

kitten smoothie posted:

They did nothing with the radar I filed three months ago, but at least it looks like it's been fixed in 7.1, thankfully.
I recently got a response: 'Is it still broken in 7.1?' I think that's as close to 'We fixed it!' as you'll ever get.

NoDamage
Dec 2, 2000
Is anyone aware of a Calendar style component for OS X? I am getting the feeling that I'm going to have to entirely hand roll my own.

Hughlander
May 11, 2005

Has anyone ever looked at the memory footprint of the various JSON deserializers? I've got some really oddly organized legacy documents that with RapidJSON just seem to balloon incredibly. (One JSON file ~100k in size that contains 1700 NSDictionary sub tree/values. If I was reading that correctly it was almost 6 megs in memory size. Though the more I think about it the more I doubt the number and will need to look at it closer.

I've always traded speed for anything else when it came to JSON but now that I'm using Mik Ash's future libraries I'm starting to think that I'd rather trade memory for anything else.

ptier
Jul 2, 2007

Back off man, I'm a scientist.
Pillbug
I wanted to let you guys know that I am looking to get hired in a remote tech / QA support position for OSX / iOS / Web Apps with possible light programming duties. I'll keep it short and just send you over to the SH/SC Job Fair post if anyone has any leads / ideas. Thanks for taking a read.


If this is the wrong place to throw this I sincerely apologize.

lord funk
Feb 16, 2004

How do you delete a remote Git branch in Xcode? The delete button is grayed out in the Source Control >> Working Copies >> Configure ... window.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

lord funk posted:

How do you delete a remote Git branch in Xcode? The delete button is grayed out in the Source Control >> Working Copies >> Configure ... window.

Dig through your .xcodeproj searching for relevant strings using your favourite grep-alike?

lord funk
Feb 16, 2004

pokeyman posted:

Dig through your .xcodeproj searching for relevant strings using your favourite grep-alike?

Not sure what you mean. The repository on my Server machine has a bunch of Git branches, how does the local .xcodeproj factor in?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

lord funk posted:

Not sure what you mean. The repository on my Server machine has a bunch of Git branches, how does the local .xcodeproj factor in?

Oh I thought you wanted to hide a remote in Xcode. Sorry! No idea how to delete a remote branch.

Froist
Jun 6, 2004

lord funk posted:

How do you delete a remote Git branch in Xcode? The delete button is grayed out in the Source Control >> Working Copies >> Configure ... window.

Not sure in Xcode terms but it's easy enough from the terminal; "git push origin --delete branchName"

dc3k
Feb 18, 2003

what.
I spent about 3 hours today trying to hunt down a bug in my collection view logic. It didn't happen on the iOS7 sim, the iOS6 sim or the iOS6 device. It did happen on the iOS7 device. I was literally banging my head on my desk until I realised it was due a wacky thing that only happened when using a distribution profile to build for the iOS7 device. :doh:

Doc Block
Apr 15, 2003
Fun Shoe
Hate it when that happens. Once spent hours trying to figure out why something wasn't working right, turns out it was because I typed 6.0 instead of 60.0.

Fate Accomplice
Nov 30, 2006




I got you guys beat. I once cleared 10+ critical bugs that showed up out of the blue one day with a single character fix. instead of traversing an array element by element, I was just reading the first element over and over.

[someArray objectAtIndex:0] ... -> [someArray objectAtIndex:i]

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Malloreon posted:

I got you guys beat. I once cleared 10+ critical bugs that showed up out of the blue one day with a single character fix. instead of traversing an array element by element, I was just reading the first element over and over.

[someArray objectAtIndex:0] ... -> [someArray objectAtIndex:i]

Nice!

Also why weren't you using an iterator?

lord funk
Feb 16, 2004

How many of us have done this:

code:
- (Thing *)thing {
    if (_thing) {
        _thing = [[Thing alloc] init];
    }
    return _thing;
}
Why isn't it appearing ahhhhh. :)

dc3k
Feb 18, 2003

what.

lord funk posted:

How many of us have done this:

code:
- (Thing *)thing {
    if (_thing) {
        _thing = [[Thing alloc] init];
    }
    return _thing;
}
Why isn't it appearing ahhhhh. :)

There's also:

code:
- (Thing *)thing {
    if (!_thing) {
        _thing = [[Thing alloc] init];
    }
    return self.thing;
}
And then you hit Run and your device bursts into flames.

lord funk
Feb 16, 2004

status posted:

And then you hit Run and your device bursts into flames.

The fan noise is its own kind of debugging message.

LP0 ON FIRE
Jan 25, 2006

beep boop
In iOS 6 I had drawing text as fills and strokes, so I could have outlined text, working fine. Still works in iOS 7, but it's deprecated.

code:
//draw fill on top of stroke
    CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
    CGContextSetTextDrawingMode(context, kCGTextFill);
    CGContextSaveGState(context);
    [text drawAtPoint:CGPointMake(2,0) withFont:font];
So I changed it to this:

code:
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
	
NSDictionary *attributes = @{ NSFontAttributeName: font,
					      NSParagraphStyleAttributeName: paragraphStyle };

//draw fill on top of stroke
    CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
    CGContextSetTextDrawingMode(context, kCGTextFill);
    CGContextSaveGState(context);
    [text drawAtPoint:CGPointMake(2,0) withAttributes:attributes];
But now I don't see the filled text. What am I doing wrong here?

dizzywhip
Dec 23, 2005

Not sure how those CG functions work, but my guess is that they don't apply when drawing text with attributes. The text color is determined by NSForegroundColorAttributeName, and the default is black. I'm guessing it's not showing up because you're drawing on a black background. Just add that attribute and get rid of the fill color / drawing mode CG functions and you should be good.

LP0 ON FIRE
Jan 25, 2006

beep boop
That was it! Thank you so much. I guess I don't understand this dictionary attribute stuff, but I can see how it's easier to list it all out like that.

Fate Accomplice
Nov 30, 2006




ultramiraculous posted:

Nice!

Also why weren't you using an iterator?

I was actually thinking that while I was writing out the post last night. I think I'm remembering the exact issue right, just that the change was "0" to "i" and it fixed any number of blockers. I'll try and figure out what it was.

Pollyanna
Mar 5, 2005

Milk's on them.


Is there a reason why PyObjC takes forever to build?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
It has bindings for all of the standard libraries, so it is very large.

damaca
Feb 7, 2009
I'm a novice ObjC coder, so I apologise if I get the nomenclature wrong.

Does anyone have a decent tutorial of how to filter keys of a plist into an array? I'm looking to build a Table with the names of each item. Currently, each item has keys set up for name, summary, and image. So what I'm hoping to build an array with name1, name2, name3... etc.

I should add, the plist is an array that contains dictionaries.

Sorry if this is a rookie question. I will edit this post if I find what I'm needing.

damaca fucked around with this message at 05:28 on Dec 13, 2013

dc3k
Feb 18, 2003

what.

damaca posted:

I'm a novice ObjC coder, so I apologise if I get the nomenclature wrong.

Does anyone have a decent tutorial of how to filter keys of a plist into an array? I'm looking to build a Table with the names of each item. Currently, each item has keys set up for name, summary, and image. So what I'm hoping to build an array with name1, name2, name3... etc.

Sorry if this is a rookie question. I will edit this post if I find what I'm needing.

I assume your plist is just an array of items, each item having the 3 key-value pairs?

NSArray *plistArray = [NSArray arrayWithContentsOfFile:file];

Now you can just do something like
code:
for (NSDictionary *dictionary in plistArray) {
    //do something here with [dictionary objectForKey:@"name"];
}

damaca
Feb 7, 2009

status posted:

I assume your plist is just an array of items, each item having the 3 key-value pairs?

NSArray *plistArray = [NSArray arrayWithContentsOfFile:file];

Now you can just do something like
code:
for (NSDictionary *dictionary in plistArray) {
    //do something here with [dictionary objectForKey:@"name"];
}
Thanks for that.

However, I just discovered it's an array with dictionaries for the various items. You can see the structure at the place I stole it from - http://www.raywenderlich.com/12444/objectively-speaking-a-crash-course-in-objective-c (search for 'Property Lists Rule!', and it should be below that).

Here's a screenshot of the Property List in my app (repeating for item 1, item 2, etc):


That tutorial also made use of NSBundle to load the plist, but I noticed that you can achieve that with NSArray directly?

EDIT - I misread your script. Apparently having dictionaries is fine for the code you've written?

damaca fucked around with this message at 05:50 on Dec 13, 2013

Adbot
ADBOT LOVES YOU

dc3k
Feb 18, 2003

what.
Right, so the code I posted above would work. When I said "I assume your plist is just an array of items, each item having the 3 key-value pairs?" what I really meant was "I assume your plist is just an array of NSDictionary objects", since an NSDictionary is just a key-value association. The use of NSBundle is to find your .plist file inside the application bundle.

I think this code would accomplish what you want:

code:
NSString *file= [[NSBundle mainBundle] pathForResource:@"someFileName" ofType:@"plist"];
NSArray *plistArray = [NSArray arrayWithContentsOfFile:file];

for (NSDictionary *dictionary in plistArray) {
    NSLog(@"%@",[dictionary objectForKey:@"name");
}
That would just print each "name" item to the console. The for loop just takes your plistArray object and reads each item as an NSDictionary. If you had an array of some other object type, say NSString, you could do something similar: for (NSString *string in someArray) { ... }

Here's a quick tutorial on it: http://iosdevelopertips.com/objective-c/fast-enumeration-on-the-iphone.html

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