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

eschaton posted:

You shouldn't need to turn off ARC, ARC is just on by default in new projects, it won't be flipped on for old projects.

Similarly, you shouldn't need to either convert to ARC or convert to modern Objective-C just to start making a few changes. Were this a project I were taking on, I'd try to keep the codebase as close to the original as possible as I'm coming up to speed on it.

Every single bit of the codebase belongs in the coding horrors thread, so anything the auto-conversions do can only be an improvement. Apparently the guy was a web design student at a local college who go the job because he agreed to work for $8/hr. :v:

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I would be worried about breaking something that e.g. only works now by accident and breaks when the ARC migrator comes through making seemingly logical changes.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

I am constantly in that state of worry. I tell myself it's professionalism, but it's really just cowardice.

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?

pokeyman posted:

I would be worried about breaking something that e.g. only works now by accident and breaks when the ARC migrator comes through making seemingly logical changes.

Yeah, that's another good reason not to run the converter immediately. You'd be better off first fixing all of the static analyzer issues, and only then running the converter.

kode54
Nov 26, 2007

aka kuroshi
Fun Shoe
How nice, it's no longer (easy? even possible at all?) to query the exact model string of an optical drive, or at least an Apple SuperDrive. They all identify as "Apple SuperDrive" in the device info, making it impossible to differentiate between the many vendors they use, for purposes of looking up the drive's read and possibly burn offsets in a database. Known to affect XLD and dbPowerAMP, unless someone in this topic can tell me there's a new API in El Capitan for querying that older info. (New API info would benefit both projects, as I could notify the XLD author, and also the Mac porter of the dBPA product.)

Froist
Jun 6, 2004

pokeyman posted:

I would be worried about breaking something that e.g. only works now by accident and breaks when the ARC migrator comes through making seemingly logical changes.

Yeah, the automatic converter tools aren't flawless. I ran them (both ARC and modern syntax) over my company's codebase a couple of months ago as part of a bigger modernisation project - the things they suggested changing all seemed logical but there were quite a few bugs introduced because of it. The modern syntax one is presumably responsible for a shedload of new warnings we get when building in Xcode 7 related to designated initialisers (I've put off looking into that properly for a couple of weeks until we have our current release out).

Jumping into a new codebase I wouldn't run the conversion immediately, there's no requirement to use ARC right now as eschaton says. Just remember to have your non-ARC hat on when adding any code - it's easy to forget and add leaks.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

eschaton posted:

Yeah, that's another good reason not to run the converter immediately. You'd be better off first fixing all of the static analyzer issues, and only then running the converter.

I'm not sure how many of the over 2400 issues I'd get to before burning through their budget w/o actually making any of the changes they want.

Froist posted:

Jumping into a new codebase I wouldn't run the conversion immediately, there's no requirement to use ARC right now as eschaton says. Just remember to have your non-ARC hat on when adding any code - it's easy to forget and add leaks.

Leaks were at least 1000 of those, so the dev before already had plenty :v:

EDIT: But yes, I'll make sure to be on the lookout for odd behavior and so on, and I appreciate the advice / warnings!

Lumpy fucked around with this message at 18:28 on Oct 6, 2015

Doc Block
Apr 15, 2003
Fun Shoe
Just wanna say that Apple's Metal instrumentation is really great.



Click on any of the Metal calls on the left & it shows what the frame looks like up to that point, all the various color attachments, how long each draw call took, plus the split between CPU and GPU time, and even a breakdown on what parts of the GPU are busy doing what.

emoji
Jun 4, 2004
I can't get any of the SceneKit/ModelIO integration to work. If I create a new iOS game project w/ SceneKit it starts a basic project with assets. Nothing at the top of this page seems to work, although I do have little objc experience. I have tried every combination of latest stable Xcode, latest Beta, iOS 9.0 and iOS 9.1.


Objective-C code:
    // create a new scene
    SCNScene *scene = [SCNScene sceneNamed:@"art.scnassets/ship.scn"];
    
    //my only addition besides importing ModelIO in header file
    MDLAsset *myAsset = [MDLAsset assetWithSCNScene:scene]; //No known class method for selector 'assetWithSCNScene:'
    
I can jump to the definitions like assetWithSCNScene and can't see anything I'm doing wrong.

Objective-C code:
@interface MDLAsset (SCNModelIO)
+ (instancetype)assetWithSCNScene:(SCNScene *)scnScene NS_AVAILABLE(10_11, 9_0);
@end

Doc Block
Apr 15, 2003
Fun Shoe
Are you targeting OS X El Capitan (10.11) or iOS 9.0+?

emoji
Jun 4, 2004
I have tried both, and it should work in either.

EngineerJoe
Aug 8, 2004
-=whore=-



Is anyone working on any Apple TV apps? I got the dev kit yesterday and I'm going to see how difficult it is to port something over soon.

Doc Block
Apr 15, 2003
Fun Shoe
I am. Everything works pretty much as-expected: UIKit's there, as are most iOS frameworks.

Thoughts:
tvOS not having the Multipeer Connectivity framework is a huge bummer. I want to make an iOS app work as a controller for my AppleTV game, but it's gonna be less user friendly since I have to use Core Bluetooth instead of Multipeer Connectivity, and Core Bluetooth requires devices to be paired (as far as I know, anyway; I haven't gotten that far along with my game yet).

I'd never used the GameController framework before, so it wasn't quite what I expected, but now that I've gotten the hang of it it's pretty nice.

And, of course, you have no persistent local storage. But CloudKit is easy enough for save games etc.

Kallikrates
Jul 7, 2002
Pro Lurker
Multipeer Connectivity seems like big thing to not include?

Imagine all the party games that need to work around it.

emoji
Jun 4, 2004

emoji posted:

I can't get any of the SceneKit/ModelIO integration to work. If I create a new iOS game project w/ SceneKit it starts a basic project with assets. Nothing at the top of this page seems to work, although I do have little objc experience. I have tried every combination of latest stable Xcode, latest Beta, iOS 9.0 and iOS 9.1.


...

Got an answer for this. I had to import <SceneKit/ModelIO.h> explicitly, even though it was able to autocomplete and jump to definitions just fine, making me think that it was imported since it did not give me the Declaration of 'X' must be imported from module 'Y' before it is required that it usually does. Seems like it should be able to resolve this?

Doc Block
Apr 15, 2003
Fun Shoe
That's just the way the C separate compilation model works. Strange that Xcode could autocomplete it, though.

Fate Accomplice
Nov 30, 2006




https://www.macstories.net/linked/the-background-data-and-battery-usage-of-facebooks-ios-app/

I think we've got some fb ios people here - how does fb's app keep using data when the user has explicitly turned off background app refresh?

Is it by running silent audio in the background?

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

It's almost certainly accounted that way because apps keep running for 10 seconds after switching away, and switching back and forth frequently is very common with FB. It also runs briefly when notifications are received I believe.

It doesn't run background audio or do anything to intentionally subvert the background-operation policies.

Kallikrates
Jul 7, 2002
Pro Lurker
You get 30seconds of active(background) time with content-available push messages also. You can do this as much as you want subject to APNS Rate limits and user settings. These also disable when the user turns off push messages.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
You know, every time I get back into doing iOS dev, I wonder why it is I stopped doing it so much. Then I see Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile specified in your build settings and I remember....

Kallikrates
Jul 7, 2002
Pro Lurker
Clicking around a web UI so you can run your code is the worst. Thankfully certain tasks are slowly moving into Xcode. One day I hope to only log into member center to download Xcode and other software.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
So is there some trick to getting a build out of "Processing"? :google: suggests bumping the build number and submitting over and over until one goes through fast, but that doesn't seem quite right. My first one went through fast, but the one I submitted two hours ago is still hanging out. (Or is several hours normal now?)

Froist
Jun 6, 2004

I've come across what feels like a pretty fundamental issue that's popped up in iOS 9, and is completely reproducible in a noddy app. Basically long-pressing links in a UIWebView which is contained in a modally presented view controller does nothing on the device and just logs errors to the Xcode console. I tried switching to WKWebView but the issue still occurs there.

With a regular presentation of the containing controller I get:
code:
Warning: Attempt to present <UIWebRotatingAlertController: 0x1550cec00> on
<ViewController: 0x15470ac40> whose view is not in the window hierarchy!
And if I set the owning controller's presentation style to FormSheet (my actual use case) I get:
code:
Warning: Attempt to present <UIWebRotatingAlertController: 0x13102b000> on
<ViewController: 0x12fd2f090> which is already presenting <HelpViewController: 0x12ff53740>
The only difference in the above when using WKWebView is that UIWebRotatingAlertController becomes WKActionSheet. The "ViewController" is my initial view loaded from the default storyboard, and HelpViewController is the view I'm presenting modally (which just contains a WebView in this sample case).

Is there something I'm obviously doing wrong here, or did I miss the memo where we shouldn't use UIWebViews in modally presented views? I'm really reluctant to branch the functionality and use a SafariViewController on iOS 9, mostly because this is only ever used for static in-app HTML-based help pages.

Froist fucked around with this message at 17:33 on Oct 15, 2015

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
It's not surprising; the long press wants to present another modal view or popover while you're already presenting one. Can you try HelpViewController.definePresentationContext = true

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Lumpy posted:

So is there some trick to getting a build out of "Processing"? :google: suggests bumping the build number and submitting over and over until one goes through fast, but that doesn't seem quite right. My first one went through fast, but the one I submitted two hours ago is still hanging out. (Or is several hours normal now?)

I've had several multi-hour "Processing" builds in the last couple weeks, so you're not alone.

Froist
Jun 6, 2004

Ender.uNF posted:

It's not surprising; the long press wants to present another modal view or popover while you're already presenting one.
True I guess, but it feels like that's an internal implementation detail of the webview. It was showing a UIActionSheet which wasn't a view controller previously, and it's only the deprecation in iOS 9 and seeming internal refactoring that has caused that view to become a view controller presentation (similar to how UIAlertViews became view controllers in iOS 8). This always worked fine in earlier versions of iOS, and there were SO many apps around which presented a web view modally when creating an in-app browser that I'm surprised I can't find any discussion of this problem elsewhere.

Ender.uNF posted:

Can you try HelpViewController.definePresentationContext = true

This made no difference unfortunately, but thanks. Actually the whole issue's become a bit moot - we've decided to prevent the long-press as it really doesn't add anything valuable in 99% of cases.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Anyone run into a situation where the app will get evicted by jetsam but memory usage just prior to the eviction shows you aren't using much memory? The jetsam log shows our app is using around 150MB. Instruments VM tracker shows a similarly low amount of memory used. But the system total uncompressed pages is close to the amount of physical memory.

I have a suspicion it's GPU texture memory somewhere but I can't figure out what is causing it, nor even confirm that's the problem. I also see ~600MB under "fileBacked" which seems strange to me.

emoji
Jun 4, 2004
Every time I try to call MDLVoxelArray outside the simulator on an actual device it fails with EXC_BAD_ACCESS(code=1, address=0x68).

In this example I've created a new SceneKit iOS project in Swift and added the following lines (and .obj file to asset folder). It runs fine on the simulator and I am able to inspect the MDLVoxelArray there. myAsset is being used further down and is not being released. I have tried this on an iPhone 5s and 6s with iOs 9.0.2 and 9.1 beta 5 respectively, in current and beta Xcode. I have the same issue trying with objc.
Swift code:

let myURL = NSURL(fileURLWithPath: resourcePath + "/art.scnassets/myobj.obj")  
let myAsset = MDLAsset(URL: myURL, vertexDescriptor: nil, bufferAllocator:nil)  
let myVoxels = MDLVoxelArray(asset: myAsset, divisions: 4, interiorShells: 0, exteriorShells: 0, patchRadius: 0.1) //always fails here  
code:

0x100078934 <+108>: ldur   w1, [x29, #-16]  
0x100078938 <+112>: ldur   w2, [x29, #-12]  
0x10007893c <+116>: ldur   w3, [x29, #-8]  
0x100078940 <+120>: ldur   s0, [x29, #-4]       ;arguments for call  
0x100078944 <+124>: ldr    x4, [sp]  
0x100078948 <+128>: bl     0x100079448               ; @nonobjc __ObjC.MDLVoxelArray.init (__ObjC.MDLVoxelArray.Type)(asset : __ObjC.MDLAsset, divisions : Swift.Int32, interiorShells : Swift.Int32, exteriorShells : Swift.Int32, patchRadius : Swift.Float) -> __ObjC.MDLVoxelArray at GameViewController.swift  
0x10007894c <+132>: mov    sp, x29    ; Thread 1: EXC_BAD_ACCESS(code=1, address=0x68)  
0x100078950 <+136>: ldp    x29, x30, [sp], #16  
Any ideas?

emoji
Jun 4, 2004
Screw the API. I ended up manually implementing importing/rendering to SceneKit for MagickaVoxel files. I had no idea what I was doing this morning having never really used NSData/Swift etc but ended up with a 100-line class that given a file URL converts the .vox files to NSData structures that map to SCNNodes. After spending way too much time figuring out basic knowledge it was much easier than I anticipated and actually works in Playgrounds unlike half the APIs I try!! I will use Swift again!


emoji fucked around with this message at 01:59 on Oct 18, 2015

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Very nice! I had not heard of MagicaVoxel before, looks p cool.

HaB
Jan 5, 2001

What are the odds?
Been a while since I have updated XCode.

Is 7.1b3 worth it or should I just grab 7.0.1?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

HaB posted:

Been a while since I have updated XCode.

Is 7.1b3 worth it or should I just grab 7.0.1?

I'd suggest 7.0.1.

Nothing stopping you from downloading both.

Doc Block
Apr 15, 2003
Fun Shoe
You can run the official release and a beta side by side.

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

Ender.uNF posted:

Anyone run into a situation where the app will get evicted by jetsam but memory usage just prior to the eviction shows you aren't using much memory? The jetsam log shows our app is using around 150MB. Instruments VM tracker shows a similarly low amount of memory used. But the system total uncompressed pages is close to the amount of physical memory.

I have a suspicion it's GPU texture memory somewhere but I can't figure out what is causing it, nor even confirm that's the problem. I also see ~600MB under "fileBacked" which seems strange to me.

Not that anyone cares but the woefully out of date CoreImage documentation states that a CIContext is immutable and thus safe to re-use among threads. What they don't point out is that any texture memory allocated while processing is kept alive forever until the CIContext is deallocated. Normally my immutable objects don't consume all available memory if left alive too long but there you have it.

Note that is is backwards from what you'd expect: You can keep a ton of CIImage, CIFilter, and CIKernel objects around without consuming much memory but God help you if you don't recreate the context on a semi-regular basis.

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:
Quick question for anyone using the Facebook Graph API... Can I get a list of a users friends and their profile pics if the friends themselves are not using this app? Some people say you can and some you can't and it's confusing as gently caress.

Froist
Jun 6, 2004

thegasman2000 posted:

Quick question for anyone using the Facebook Graph API... Can I get a list of a users friends and their profile pics if the friends themselves are not using this app? Some people say you can and some you can't and it's confusing as gently caress.

No, the API changed earlier this year so you only see friend results if both the current user and the friend are using the app. You can still send invites to friends using a different API, but they won't show up in the friend list until they've chosen to enable the app. Prior to the change all the current user's friends were returned in the friend list call, which may be where the confusion is coming from.

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:
Ah ok that makes sense... Could I leaverage the send a friend invite to get the names and small profile pics?

Froist
Jun 6, 2004

I don't think so - it's a while since I looked at the code of the app we use it in, but from memory you call an "Invite" API and it presents a web view where the user can pick from their friends. I guess you may be able to do something horrible like proxying those requests and intercepting the info, but I'm pretty sure it's not supported in any official way.

thegasman2000
Feb 12, 2005
Update my TFLC log? BOLLOCKS!
/
:backtowork:

Froist posted:

I don't think so - it's a while since I looked at the code of the app we use it in, but from memory you call an "Invite" API and it presents a web view where the user can pick from their friends. I guess you may be able to do something horrible like proxying those requests and intercepting the info, but I'm pretty sure it's not supported in any official way.

I will explain the whole app idea to you and see if you can help me figure a way around this issue.

I download the app... I link it to my facebook and I get a list of my friends.. I select one and then the app opens a FAKE messenger page. I can then write a conversation. Typing BOTH sides of it. So I can mess about and have some fun. Then it posts the page to the real FB when I press a button.

The FAKE messenger page looks like an ordinary messenger app in the same style with the little circle profile pics and friend name.

So with the old API this is a walk in the park. Now not so much. I am thinking when you invite a friend it pulls their names and profile pics. Thats all I want to be able to use in the secondary page.

Adbot
ADBOT LOVES YOU

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I want to learn iOS app development. I have Xcode downloaded and installed but I'm not signed up to be a developer. How much can I do before I have to pay the $99? Am I able to code some things and deploy them to my phone to test and play around with? I also saw that to register I can choose between an individual or company account, company account requiring me to actually found a company as an LLC or something, while an individual account would publish all my apps under my real name if I ever got that far. Is it easy/possible to just start an individual account and later on if I think I've got something then I could convert it to a company account?

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