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
kitten smoothie
Dec 29, 2001

Axiem posted:

I'm presuming the Enterprise account works just like a small company, except with more weird things around provisioning profiles.

With enterprise distribution there's no UDID registration process. The provisioning profile bundled with the app specifies that it can run on any device. You are contractually obligated not to distribute the .ipa to anyone outside your organization. If Apple catches you they will ban your developer account.

Adbot
ADBOT LOVES YOU

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Axiem posted:

How does this change if it's not actually the case that Alice, Bob, and Carol have their *own* machines, but will randomly use one of the three machines in the office on any given day?

They should still each have their own home directory, either per-Mac or on a shared server.

They should really, really not all be logging in to a single shared account and entering their personal credentials for provisioning and such.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Filburt Shellbach posted:

code:

(lldb) p destination.section
error: property 'section' not found on object of type 'NSIndexPath *'

lldb, quit gaslighting me about this one. Jesus.

Possibly dumb question: does it want you to explicitly dereference the pointer?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Subjunctive posted:

Possibly dumb question: does it want you to explicitly dereference the pointer?
That's not how obj-c objects work.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Subjunctive posted:

Possibly dumb question: does it want you to explicitly dereference the pointer?

There should be no need when using dot syntax. I think it works if you phrase it as a message send though.

(This kind of thing is what I was whining about a few pages ago with lldb and category methods.)

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do

pokeyman posted:

I'll hit the parts that I didn't see answered here. Overall though you might be better off calling Apple and asking them directly about what you want to do (you're being a little vague). They're not too bad on the phone.

I'm vague mostly because I'm trying to understand at an abstract level how it all works. My group at work has been futzing around with provisioning profiles and certificates, and I'm halfway lost mostly because of this underlying abstraction.

Between the answers here and some of the other poking around we were able to do, I think I've got most of it straight.

eschaton posted:

They should still each have their own home directory, either per-Mac or on a shared server.

They should really, really not all be logging in to a single shared account and entering their personal credentials for provisioning and such.

At my workplace, we do pair programming, so developers really don't have "their" machine. How do you propose not sharing accounts for provisioning etc.?

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

Axiem posted:

I'm vague mostly because I'm trying to understand at an abstract level how it all works. My group at work has been futzing around with provisioning profiles and certificates, and I'm halfway lost mostly because of this underlying abstraction.

Between the answers here and some of the other poking around we were able to do, I think I've got most of it straight.


At my workplace, we do pair programming, so developers really don't have "their" machine. How do you propose not sharing accounts for provisioning etc.?

Every developer has their own Apple ID. The account administrator can make other IDs developers, contract signers, etc.

Every developer has a certificate. When you sign builds, that is what is signing the build. The provisioning profile is a red-herring, Xcode used to reverse lookup the private key of your certificate by checking for the list of allowed signers in the profile, then looking for a matching key in your keychain. I think that confused a lot of people and the new Xcode doesn't work that way anymore.

The profile lists one or more application IDs (or a wildcard). It lists developers' public keys. It lists granted entitlements. And for dev profiles, it lists devices. You can open the mobileprovision file in a text editor and see how it works. The device just makes sure that Apple's key signed the profile, then it's UDID is in the list, then matches the app bundle using wild cards if necessary. If all that passes, then it checks the Mach-o signature against the listed keys and if one of them passes the app runs and is granted the extra entitlements listed in the profile.

The difference between a developer profile and an ad-hoc profile, as far as I can tell, is the ad-hoc profile will show the org as the signer instead of the individual dev that actually signed the Mach-o binary.

The same exact process works for downloaded apps and it's how Gatekeeper on the Mac works... Plain old Mach-o binary signing.

Froist
Jun 6, 2004

kitten smoothie posted:

With enterprise distribution there's no UDID registration process. The provisioning profile bundled with the app specifies that it can run on any device. You are contractually obligated not to distribute the .ipa to anyone outside your organization. If Apple catches you they will ban your developer account.

You do still have the UDID registration (list of 100 devices) for deploying regular debug builds through Xcode, but you can also create IPA builds with no UDID restriction (using a different key/cert than regular builds).

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Axiem posted:

At my workplace, we do pair programming, so developers really don't have "their" machine. How do you propose not sharing accounts for provisioning etc.?

It's not so much that anyone proposes you not sharing accounts, as you need to figure out how to adapt your development workflow to not to share signing certificates and provisioning profiles.

One way to do it could be to have one member of the pair log in to their user account, so that's whose certificates and profiles get used during that pairing session. Session's over? Log out.

If all you're doing on those systems is development, it shouldn't be a big deal, and with several pairs working simultaneously you'll be doing a lot of git pulls or svn updates anyway including at the start of a pairing session.

Filburt Shellbach
Nov 6, 2007

Apni tackat say tujay aaj mitta juu gaa!

pokeyman posted:

I think it works if you phrase it as a message send though.

Unfortunately, even phrasing it as a message send still isn't enough to make it go.

code:
(lldb) p indexPath.section
error: property 'section' not found on object of type 'NSIndexPath *'
error: 1 errors parsing expression

(lldb) p [indexPath section]
error: no known method '-section'; cast the message send to the method's return type
error: 1 errors parsing expression

(lldb) p (NSUInteger)[indexPath section]
(NSUInteger) $0 = 2
And sure enough, if you look at <Foundation/NSIndexPath.h>, you'll see that -section, -row, and -item are all absent.

My guess is it's because those live in a category from UIKit designed to make NSIndexPath easier to use with UITableView, and it had never been a problem except for modern lldb.

edit: yep

Filburt Shellbach fucked around with this message at 16:08 on Mar 13, 2014

Doh004
Apr 22, 2007

Mmmmm Donuts...
Anyone know why my UIPageControl is hidden on a device (iPad), but not in the simulator?

Simulator:


Device:

(sorry for the different size, stupid screenshots).

It's the same code, both running iOS 7.0. The UIPageControl isn't using images, has a clear background, and its code is:

code:
self.pageControl = [[UIPageControl alloc] initWithFrame:CGRectMake(0, 0, 100, 10)];
self.pageControl.pageIndicatorTintColor = [UIColor lightGrayColor];
self.pageControl.currentPageIndicatorTintColor = [UIColor redColor];
self.pageControl.hidesForSinglePage = YES;
self.pageControl.numberOfPages = numberOfUpdates;
[self.pageControl addTarget:self action:@selector(changePage) forControlEvents:UIControlEventValueChanged];
Am I missing something obvious here?

*edit* This just started even since I started building with the 7.1 SDK.

Doh004 fucked around with this message at 19:01 on Mar 13, 2014

Toady
Jan 12, 2009

I've been experimenting with a Sprite Kit project with the notion of possibly developing a complete game when I'm finished with my current work. Reading this article was a little depressing.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
I'm not sure what's depressing about that. The author started by talking about some vast dreams he had about the world of mobile games magically changing overnight. It didn't. He's the only one surprised and depressed about it.

The only time the App Store was a free money printing machine was its first couple of months in existence when you could grind out a mediocre implementation of X and have a monopoly with free marketing.

Mobile game development is about the last industry to enter if you need assurance that doing a good job will lead directly to success. Do it if you enjoy doing it.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Holy poo poo you can just start typing in Xcode's method drop-down menu (the one that opens when you press control-6) and it does a fuzzy search on the contents.

Doh004
Apr 22, 2007

Mmmmm Donuts...
Tried to upload a new version, said I had to include a new large app icon.

Go to upload a new icon, get this error when trying to save it:

java.lang.RuntimeException: Failed to Create PictureFile while attempting to duplicate existing PictureFile: com.apple.jingle.eo.MZPictureFile@6eadcd73[(MZPictureFile@0x6eadcd73),token=Purple/v4/d3/86/57/d38657b2-3087-9ee4-1f8c-7ff4954e6b87/mzl.iwauzrne.png,type=(MZPictureFileType#11) LargeApplicationIcon]

Probably why it's asking me again for a new app icon.

I wanted to submit this before the weekend gosh darnit :argh:

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Pro tip #05820598:
NSInteger is now 64-bit on arm64; that means a bunch of useless warnings everywhere about precision loss right? WRONG.

Here's a hint: "Comparison of constant 'NSNotFound' with expression of type 'int' is always true". Uh-oh. Fix your integer warnings and kick yourself for not using NSInteger because every count, index, et al in the whole of Cocoa appears to be NSInteger or NSUInteger.


Pro tip #958301:
Are C-style varargs poo poo due to complete lack of metadata? yes. Does that mean every NSLog() or other format-style statement require a different format specifier now that NSInteger has different definitions because otherwise the callee can't tell where the hell the parameter is or what size it is? yes, yes it does. Should we still have to deal with that in the Year of our Lord Two Thousand and Fourteen? No. Can you save me from that 1970s bullshit? Why yes, yes I can:

code:
NSLog(@"butts: %i", array.count); 
becomes:
code:
NSLog(@"butts: %@", @(array.count));
Thanks to the magic of tagged pointers on 64-bit, the second form is nearly free and does not actually box the value as an NSNumber instance. The future is so bright you're gonna need shades.

Simulated fucked around with this message at 04:57 on Mar 16, 2014

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Ender.uNF posted:

Pro tip #958301:
Are C-style varargs poo poo due to complete lack of metadata? yes. Does that mean every NSLog() or other format-style statement require a different format specifier now that NSInteger has different definitions because otherwise the callee can't tell where the hell the parameter is or what size it is? yes, yes it does. Should we still have to deal with that in the Year of our Lord Two Thousand and Fourteen? No. Can you save me from that 1970s bullshit? Why yes, yes I can:

code:
NSLog(@"butts: %i", array.count); 
becomes:
code:
NSLog(@"butts: %@", @(array.count));
Thanks to the magic of tagged pointers on 64-bit, the second form is nearly free and does not actually box the value as an NSNumber instance. The future is so bright you're gonna need shades.

Other options include:

Objective-C code:
NSLog(@"butts: %lu %ld", (unsigned long)array.count, (long)indexPath.row);
NSLog(@"butts: %tu %zd", array.count, indexPath.row);
Xcode and the String Programming Guide recommend the first option. The second option coincidentally lines up with NSU?Integer on all currently available platforms. (%tu is a ptrdiff_t, %zd is a size_t)

Doc Block
Apr 15, 2003
Fun Shoe
Can someone explain why they'd make NSInteger 64-bit and make CGFloat a double on ARM64?

Like, they added all these extra registers to the hardware, and then waste them by doubling the size of two of the most commonly used types (as far as Foundation and UIKit go, anyway)? On what planet does anyone need a double for positioning UI elements? Or a 64-bit integer for a table view or whatever?

It occurred to me that they might be doing this to keep pace with 64-bit code on OS X, but then why did they do it on OS X? How many apps actually benefit from 64-bit integers and double precision floats?

And for most situations where you do need a 64-bit type, isn't it better to use one that's explicitly 64-bit? Like an int64_t or a double or something?

Doc Block
Apr 15, 2003
Fun Shoe
Also, am I the only one getting this:



The OS X App Store does this every so often, where it will want me to update the same app multiple days in a row.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I installed one of the iTunes updates a dozen or so times before it stopped showing up.

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

Doc Block posted:

Can someone explain why they'd make NSInteger 64-bit and make CGFloat a double on ARM64?

Like, they added all these extra registers to the hardware, and then waste them by doubling the size of two of the most commonly used types (as far as Foundation and UIKit go, anyway)? On what planet does anyone need a double for positioning UI elements? Or a 64-bit integer for a table view or whatever?

It occurred to me that they might be doing this to keep pace with 64-bit code on OS X, but then why did they do it on OS X? How many apps actually benefit from 64-bit integers and double precision floats?

And for most situations where you do need a 64-bit type, isn't it better to use one that's explicitly 64-bit? Like an int64_t or a double or something?

The registers are now 64-bits wide. Using a 32-bit integer just masks off the upper bits, you don't actually get to use it as a dual register without a bunch of extra instructions that cost more than you can ever gain masking and shifting before and after every operation.

I presume the CPU designers do it this way for power budget reasons. Registers are relatively expensive and the logic gates required to make an ALU understand how to treat it as dual registers, the fuckery it would play with the register file, etc just costs a lot of transistors you could use on a larger cache (or lower power budget) and get better performance (or battery life) anyway.* Once you go super-scalar, clever tricks can become not so clever.

* I don't know if the A7 uses a register renaming file but if not a future processor will. Everything old is new again. If you want to know what the next 10-15 years of mobile CPUs will look like, just check the history of desktop CPUs starting with the Pentium.

ptier
Jul 2, 2007

Back off man, I'm a scientist.
Pillbug

Ender.uNF posted:



* I don't know if the A7 uses a register renaming file but if not a future processor will. Everything old is new again. If you want to know what the next 10-15 years of mobile CPUs will look like, just check the history of desktop CPUs starting with the Pentium.

Just as long as we can just skip over the massive pipelining of the P4 era and get to the "core" type of improvements. I'd rather not go through the malaise era again.

haveblue
Aug 15, 2005



Toilet Rascal
May as well ask here- what's a good JSON editor for OS X? It's kinda odd that Xcode doesn't have one built in.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

ptier posted:

Just as long as we can just skip over the massive pipelining of the P4 era and get to the "core" type of improvements. I'd rather not go through the malaise era again.

I think we'll probably follow the SPARC/MIPS line more than the Pentium one, if only because the x86's register scarcity and historic compatibility burden sort of distorted its development. Hopefully we won't have to program around delay slots, though.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

haveblue posted:

May as well ask here- what's a good JSON editor for OS X? It's kinda odd that Xcode doesn't have one built in.

What features do you require of a "JSON editor"? All I can think of is "syntax highlighting", which Xcode can approximate at least, and every other text editor will do properly.

haveblue
Aug 15, 2005



Toilet Rascal
I was hoping for something like the Xcode plist editor- a heirarchal semi-shell over the raw text that handles all the braces, brackets, and commas for you.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

haveblue posted:

I was hoping for something like the Xcode plist editor- a heirarchal semi-shell over the raw text that handles all the braces, brackets, and commas for you.

Oh, that'd be sweet.

Feel like writing an Xcode plugin?

haveblue
Aug 15, 2005



Toilet Rascal
Not on company time, but if no such things exists I might give it a shot. Where would I get started with such a project?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

haveblue posted:

Not on company time, but if no such things exists I might give it a shot. Where would I get started with such a project?

Here's a template for making a project that'll get you loaded into Xcode's process. From there it's a lot of guess and check with things like class-dump, F-Script, and/or dtrace. In retrospect this is probably a much larger project than I originally guessed.

I'd probably start by figuring out how the plist editor works. Assuming it's some kind of NSDocument-based thing, you could write your own for JSON, have it work with the existing plist editor window, then get Xcode to call you up when editing JSON.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

haveblue posted:

I was hoping for something like the Xcode plist editor- a heirarchal semi-shell over the raw text that handles all the braces, brackets, and commas for you.

You could edit it as a plist in Xcode and use plutil to convert it to JSON at build time.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

eschaton posted:

You could edit it as a plist in Xcode and use plutil to convert it to JSON at build time.

This is by far the superior solution. Could even use a little command-line wrapper for non-project use, that pops open Xcode and converts in the background whenever the file changes.

Peanut and the Gang
Aug 24, 2009

by exmarx
I want to make a method that pops up a confirm box with "Yes" and "No" options. The problem is then I'd have to build all the delegate methods in each class that uses it, and that sounds like a bit of a hassle. I'd rather make it run a block instead. Something like:
+(void)showConfirm:(NSString *)title message:(NSString *)message completionHandler:(void (^)(BOOL ok))completionHandler

How would I go about making it use UIAlertView (or something else) but allow a block instead of setting delegates? This code looks like what I want: https://github.com/jivadevoe/UIAlertView-Blocks/blob/master/UIAlertView%2BBlocks.m
but I have no clue what the objc_setAssociatedObject(self, ...) line means, or if it's something that might break something else, and that scares me :spooky:

Carthag Tuek
Oct 15, 2005

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



What are the current ways to trick an app into loading a framework? I can do it via lldb but I'd like to to be automatic.

(lldb) p (BOOL)[[NSBundle bundleWithPath:@"Hack2/DerivedData/Hack2/Build/Products/Debug/Hack2.framework"] load]

I don't have access to the app source.

Carthag Tuek
Oct 15, 2005

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



Peanut and the Gang posted:

but I have no clue what the objc_setAssociatedObject(self, ...) line means, or if it's something that might break something else, and that scares me :spooky:

It's not possible to add ivars in categories, so the code uses associated objects instead to save the button array so it's available in the different methods. It's harmless.

Peanut and the Gang
Aug 24, 2009

by exmarx

Snapchat A Titty posted:

It's not possible to add ivars in categories, so the code uses associated objects instead to save the button array so it's available in the different methods. It's harmless.

I see. Thanks.

Would using that category be the best solution? To me, it looks like it's overwriting the clickedButtonAtIndex delegate method. So if I wanted to use the UIAlertView's delegates the normal way in the same file, I might come into trouble.
Right now I see the options as:
1. Use that category. It's simple to use, but might cause conflicts when using UIAlertView the normal way and the blocks way in the same file. Also these changes don't really fall into the Alert realm anymore, since it's code specific to Confirm dialogs.
2. Extend UIAlertView to a new class ConfirmView which adds in the delegate updates to store a block and then call it. This is good, but also bad because the docs say not to extend UIAlertView.
3. Create a new class ConfirmView, which uses a UIAlertView instance as one of its properties. Then throw a bunch of functions at that instance. Possible issues is most of the alertView methods will now be undefined for this class. (Not that bad because we can just add them when we need them)

Option 3 is actually sounding like the best option for me right now.

Fake edit: Yeah, typing that out made me decide on #3. Muchas gracias.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Snapchat A Titty posted:

What are the current ways to trick an app into loading a framework? I can do it via lldb but I'd like to to be automatic.

(lldb) p (BOOL)[[NSBundle bundleWithPath:@"Hack2/DerivedData/Hack2/Build/Products/Debug/Hack2.framework"] load]

I don't have access to the app source.

Here is a script I use for injecting F-Script into any running app, might give you something to go on:

Ruby code:

#!/usr/bin/env ruby

FSCRIPT_PATH = "/Library/Frameworks/FScript.framework"

if ARGV.empty?
  puts "Usage: #{$0} process_name"
  exit
end

GDB = IO.popen("gdb", 'w')
def gdb(cmd)
  GDB.puts cmd
  GDB.flush
end
gdb "attach '#{ARGV[0]}'"
gdb "p (char)[[NSBundle bundleWithPath:@\"#{FSCRIPT_PATH}\"] load]"
gdb "p (void)[FScriptMenuItem insertInMainMenu]"
gdb "detach"
gdb "quit"
GDB.close
puts

Carthag Tuek
Oct 15, 2005

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



pokeyman posted:

Here is a script I use for injecting F-Script into any running app, might give you something to go on:

Thanks. I ended up straight up pasting some (compiled) code over another part of the code instead. I'll keep that snippet around, though.

lmao zebong
Nov 25, 2006

NBA All-Injury First Team
Does anyone have any suggestions on how to get something equivalent to a granularly precise contentOffset in scrollViewDidScroll:?

Currently I'm animating the contentOffset of a UIScrollView, and I want a view controller in the scrollview to 'catch' another view after it slides under this view and have this caught view move along with it. However, calling setContentOffset:offsetPoint animated:YES does not actually set the contentOffset of the scrollview in a precise fashion (i.e. contentOffset == (0,0), next call contentOffset == (1,0), etc), and instead updates the content offset like (contentOffset == (5, 0), next call contentOffset == (12, 0), etc). Setting the contentOffset of the scrollview in a UIView animationWithDuration block only calls scrollViewdidScroll once. Getting the precise x offset of the scrollview is important because I need to know when the contentOffset is exactly where I want the view to be caught and start moving along with the scrollview.

Is this a case where I would want to use a keyframe animation? Or is there another method to get this information I need? I have considered things like using an NSTimer once the scrollview starts scrolling and moving the catchable view using that but that feels a bit janky.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Snapchat A Titty posted:

What are the current ways to trick an app into loading a framework? I can do it via lldb but I'd like to to be automatic.

(lldb) p (BOOL)[[NSBundle bundleWithPath:@"Hack2/DerivedData/Hack2/Build/Products/Debug/Hack2.framework"] load]

I don't have access to the app source.

If you don't have initialization requirements beyond loading (and whatever is implicit in that), then setting DYLIB_INSERT_LIBRARIES might suffice. I don't remember when in the initialization order it puts them, but I *think* early enough that you can preempt other flat-namespace symbols, so probably pretty early. man dyld will know all.

Adbot
ADBOT LOVES YOU

Filburt Shellbach
Nov 6, 2007

Apni tackat say tujay aaj mitta juu gaa!

lmao zebong posted:

I have considered things like using an NSTimer once the scrollview starts scrolling and moving the catchable view using that but that feels a bit janky.

CADisplayLink would be a less janky way to do this. It's like an NSTimer, but one that fires every time a frame is being displayed to the user.

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