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
Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

tarepanda posted:

As it appears in the app, yeah. The result of the purchase.

Odd, I just do screenshots of the purchase... Then again mine are sounds so there isn't much to see.

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
Another IAP question: one of them is an an ultimate value pack sort of thing where you get all the other IAPs for less than if you had bought them individually. How would I take a screenshot of this, other than just a shot of how it appears in the in app store?

Red Robin Hood
Jun 24, 2008


Buglord
If this is the wrong thread please point me in the right direction. I don't know the correct terminology so I will use Windows terms to describe my problem...

I need to create a .bat type file that continuously pings an IP address of my choice for two hours. After the two hours I need it to save that ping info to a text document and save it to the desktop title "PingResults.txt" or something similar.

Is that something that is possible? Easy?

Glimm
Jul 27, 2005

Time is only gonna pass you by

Red Robin Hood posted:

If this is the wrong thread please point me in the right direction. I don't know the correct terminology so I will use Windows terms to describe my problem...

I need to create a .bat type file that continuously pings an IP address of my choice for two hours. After the two hours I need it to save that ping info to a text document and save it to the desktop title "PingResults.txt" or something similar.

Is that something that is possible? Easy?

Create a file, myscript.sh
code:
#!/usr/bin/bash
ping foo > ~/Desktop/PingResults.txt
Make it executable (chmod +x myscript.sh)

Is the 2 hour thing a hard requirement?

Red Robin Hood
Jun 24, 2008


Buglord

Glimm posted:

Create a file, myscript.sh
code:
#!/usr/bin/bash
ping foo > ~/Desktop/PingResults.txt
Make it executable (chmod +x myscript.sh)

Is the 2 hour thing a hard requirement?

Not really. If they close it will it stop and then create it?

edit: additionally when I run that I get "Expected end of line, etc. but found identifier."

Red Robin Hood fucked around with this message at 23:28 on Apr 22, 2013

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

Doc Block posted:

Another IAP question: one of them is an an ultimate value pack sort of thing where you get all the other IAPs for less than if you had bought them individually. How would I take a screenshot of this, other than just a shot of how it appears in the in app store?

Well as I said, my IAPs are sound packs and they have always accepted screenshots of the in-app store.

On an unrelated note, thanks to the shutdown of Urban Airship's IAP platform, I am deploying my own cloud IAP platform. If anyone else is interested in such a service let me know. I am thinking of opening it up to third parties if there is a need to support previous iOS releases, you want to host free content, or you want to update content without going through app approval again. I am also going to build in a coupon code sort of thing. Apple may balk at that but the goal is to give you a way to let journalists/reviewers get the IAP content for free, not to bypass the App Store. The platform will be setup with a self-monitored auto-scaling system that can ramp up hundreds of nodes if needed and will host catalogs, icons, etc on a CDN.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Red Robin Hood posted:

Not really. If they close it will it stop and then create it?

edit: additionally when I run that I get "Expected end of line, etc. but found identifier."

Weird, I don't see that message. Bash might be in a different location, like this:

code:
#!/bin/bash
ping google.com > ~/Desktop/PingResults.txt
The #! just says "hey, run this using this interpreter!" (http://en.wikipedia.org/wiki/Shebang_(Unix))

I'm not sure that's the issue though, what exactly do you have in the script?

It will actually add the output to the file as the ping is going, so you could create a separate tab and do: cat ~/Desktop/PingResults.txt to see what is in there so far. Use control+c to kill the script when it's time to stop.

Red Robin Hood
Jun 24, 2008


Buglord

Glimm posted:

Weird, I don't see that message. Bash might be in a different location, like this:

code:
#!/bin/bash
ping google.com > ~/Desktop/PingResults.txt
The #! just says "hey, run this using this interpreter!" (http://en.wikipedia.org/wiki/Shebang_(Unix))

I'm not sure that's the issue though, what exactly do you have in the script?

It will actually add the output to the file as the ping is going, so you could create a separate tab and do: cat ~/Desktop/PingResults.txt to see what is in there so far. Use control+c to kill the script when it's time to stop.

When I compile this it gives me a syntax error of: "Expected end of line, etc. but found identifier."

code:
#!/bin/bash
ping google.com > ~/Desktop/PingResults.txt

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
From the "I can't believe I just found this out" department, you can edit your app description or release notes while your app is "Waiting for Review". So don't bother writing that poo poo until after you're in the queue.


Red Robin Hood posted:

writing a shell script

Maybe just pick one thread?

Glimm
Jul 27, 2005

Time is only gonna pass you by

Red Robin Hood posted:

When I compile this it gives me a syntax error of: "Expected end of line, etc. but found identifier."

code:
#!/bin/bash
ping google.com > ~/Desktop/PingResults.txt

Hmm, what do you mean 'compile this'? Just doing './myscript.sh' ?

Red Robin Hood
Jun 24, 2008


Buglord

pokeyman posted:

Maybe just pick one thread?

Sorry. From now on I'll be looking this this thread:

http://forums.somethingawful.com/showthread.php?threadid=2779598&pagenumber=256#lastpost

Mikey-San
Nov 3, 2005

I'm Edith Head!
e: didn't notice the link to the other thread was related to the Script Editor confusion

Mikey-San fucked around with this message at 07:02 on Apr 23, 2013

Hughlander
May 11, 2005

pokeyman posted:

From the "I can't believe I just found this out" department, you can edit your app description or release notes while your app is "Waiting for Review". So don't bother writing that poo poo until after you're in the queue.

There's more to it then that. You can rewrite it any time up until the next version is released (maybe approved) I believe. This came up at work for wanting to add a warning to one release of an app but not wanting it to be there for all time.

Doc Block
Apr 15, 2003
Fun Shoe
Yeah, even after the app gets approved you can edit the app description.

So if it's going on sale for a day or whatever, just edit your description early that morning to say it's on sale and then change it back at midnight or whatever.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Doc Block posted:

Yeah, even after the app gets approved you can edit the app description.

So if it's going on sale for a day or whatever, just edit your description early that morning to say it's on sale and then change it back at midnight or whatever.

Right. I should've just said release notes; of course you can edit the description whenever.

Enderzero
Jun 19, 2001

The snowflake button makes it
cold cold cold
Set temperature makes it
hold hold hold
I'm working on an ipad app that uses a 3rd party library to display and annotate pdfs. When a user taps on a highlighted section, I want to display a view in the margins that shows the comments associated with the highlighted text. The comments will essentially be a list of formatted cells that contain some labels and a "+1" button which sends a vote to the server when tapped.

What is a smart way to organize this? Would UITableView be a good fit - I'm wondering if I can be notified of a tap on the +1 button or if UITableView can only notify that the overall cell was tapped in order to show the detail view? Should my pdf view controller act as delegate for this CommentsView or should there be a separate subclass of UITableViewController that deals with all notifications? I guess the question boils down to 1. can UITableView be used this way? 2. will it require so much additional code to cope with this use case that I'd be better off making a simpler, custom structure?

Doc Block
Apr 15, 2003
Fun Shoe
You can make a button and set it as the table view cell's accessory view. Then you can respond to both taps on the cell as well as taps on the +1 button.

The actual button stuff is as easy as doing any other button in code. Just set the button's tag to the row number so you know which row's +1 button was tapped.

If this is iPad only, maybe have the whole thing based off a split view controller, with the PDF on the right side and the comments on the left. The left and right sides would be handled by separate view controllers. Have your PDF viewer post a notification when the user taps on a highlighted section, then have the left side watch for that notification and load the appropriate comments into the table view when it sees it.

Code wise, that stuff is relatively simple. Even if you don't go the split view route, UITableViews are pretty easy to work with and don't require much code for the basic functionality (and you certainly don't need a UITableViewController subclass). Just set your main view controller as its datasource and delegate, and conform to the appropriate protocols (UITableViewDataSource and UITableViewDelegate).

The advantage of the split view controller is the clean separation between the PDF and the comments, both in your code and in your UI.

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

Doc Block posted:

Yeah, even after the app gets approved you can edit the app description.

So if it's going on sale for a day or whatever, just edit your description early that morning to say it's on sale and then change it back at midnight or whatever.

I believe they have or will be closing this off, due to people abusing it, which sucks immensely.

Inevitable Ross
Jul 1, 2007
Have you accepted Bob as your personal Lord and Savior?
You definitely can't just push new screenshots willy-nilly. I wasn't sure about the app description, but if that's true, yes, it blows.

Glimm
Jul 27, 2005

Time is only gonna pass you by

Just saw WWDC tickets are going on sale tomorrow:

https://developer.apple.com/wwdc/tickets

Doc Block
Apr 15, 2003
Fun Shoe
That's one ugly logo. Let's hope the rumored UI changes in iOS 7 look nothing like that.

lord funk
Feb 16, 2004

Doc Block posted:

That's one ugly logo. Let's hope the rumored UI changes in iOS 7 look nothing like that.

Got to disagree there. I like it.

Who else is begging their boss to make a WWDC ticket a business expense?

tarepanda
Mar 26, 2011

Living the Dream

lord funk posted:

Got to disagree there. I like it.

Who else is begging their boss to make a WWDC ticket a business expense?

I think it looks terrible.

Was thinking about asking my boss but it's hard to justify since our iOS app is a loss leader... and it would be a ticket plus a trans-Pacific plane ticket. :x

Carthag Tuek
Oct 15, 2005

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



I don't mind the logo so much, but it doesn't look very "Apple"

Glimm
Jul 27, 2005

Time is only gonna pass you by

lord funk posted:

Got to disagree there. I like it.

Who else is begging their boss to make a WWDC ticket a business expense?

I actually like the logo too, but then I think the current iOS look needs drastically revamped as well.

Doh004
Apr 22, 2007

Mmmmm Donuts...

lord funk posted:

Got to disagree there. I like it.

Who else is begging their boss to make a WWDC ticket a business expense?

Just shot him an email...

lord funk
Feb 16, 2004

Doh004 posted:

Just shot him an email...

Just finished my prospectus letter and sent it off. Now my hopes are way too high. :ohdear:

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice
Hah, getting it paid for is the least of your worries. I predict sellout within a minute or two, making it a total crapshoot. At this point I wish they'd just do a lottery where you register within a 6 hour window, then they draw names.

lord funk
Feb 16, 2004

Ender.uNF posted:

Hah, getting it paid for is the least of your worries. I predict sellout within a minute or two, making it a total crapshoot. At this point I wish they'd just do a lottery where you register within a 6 hour window, then they draw names.

And I just got the green light! So I'll be there mashing the purchase button at 10:00PDT. Wish me luck.

Doh004
Apr 22, 2007

Mmmmm Donuts...

lord funk posted:

And I just got the green light! So I'll be there mashing the purchase button at 10:00PDT. Wish me luck.

:woop: Me too. I'm going to fight you, literally, for my ticket.

Carthag Tuek
Oct 15, 2005

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



Sweet, I just thought up a kinda clever way to do lazy properties using dispatch_once and method swizzling.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Doh004 posted:

:woop: Me too. I'm going to fight you, literally, for my ticket.

Goon fistycuffs at dawn Friday.

...assuming any of us get tickets.


Carthag posted:

Sweet, I just thought up a kinda clever way to do lazy properties using dispatch_once and method swizzling.


What. and why?

Why do you need to swizzle to get a lazy property? Are you implementing a general solution that looks for certain types of properties and auto-lazies them at startup?

Carthag Tuek
Oct 15, 2005

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



ultramiraculous posted:

What. and why?

Why do you need to swizzle to get a lazy property? Are you implementing a general solution that looks for certain types of properties and auto-lazies them at startup?

Yeah, basically. I'm loading a bunch of crap from files and I wanted to speed things up by having a general solution to do some parts lazily. So I basically have an empty protocol that I add to a class, and a category on NSObject. The category implements +load, which loops through all classes, and if they implement the empty protocol, looks for methods with a certain prefix. It then swizzles the getters to use the lazy getter on first call. Only ugliness currently is you need a dispatch_once_t ivar for each lazy getter, but I'm looking into using objc_getAssociatedObject with an NSValue pointer or something similar.

https://github.com/mikkelee/Gedcom-Framework/commit/8154fac2988a37a45e9ca2d330954059be940512

I'm currently only using it in one place, but it works, and cut a bunch of time off my loading.

Carthag Tuek fucked around with this message at 00:29 on Apr 25, 2013

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Carthag posted:

Yeah, basically. I'm loading a bunch of crap from files and I wanted to speed things up by having a general solution to do some parts lazily. So I basically have an empty protocol that I add to a class, and a category on NSObject. The category implements +load, which loops through all classes, and if they implement the empty protocol, looks for methods with a certain prefix. It then swizzles the getters to use the lazy getter on first call. Only ugliness currently is you need a dispatch_once_t ivar for each lazy getter, but I'm looking into using objc_getAssociatedObject with an NSValue pointer or something similar.

https://github.com/mikkelee/Gedcom-Framework/commit/8154fac2988a37a45e9ca2d330954059be940512

I'm currently only using it in one place, but it works, and cut a bunch of time off my loading.

Since you're requiring a per-class annotation anyway, why not just make a macro to define a +load in a class's @implementation? That avoids the need for this code to query literally every class in the system and avoids any potential weird ordering issues with your category vs. the classes in your executable.

Carthag Tuek
Oct 15, 2005

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



rjmccall posted:

Since you're requiring a per-class annotation anyway, why not just make a macro to define a +load in a class's @implementation? That avoids the need for this code to query literally every class in the system and avoids any potential weird ordering issues with your category vs. the classes in your executable.

That's a great idea, I'll try it out. For some reason, macros are always the last thing I think of.

Edit: Done, plus got rid of the need for a token ivar in your @implementation, so all that's needed is basically just call +setupLazyProperties before you start using them, and that's it:

https://github.com/mikkelee/Gedcom-Framework/commit/e0e8fa2c78a8fe63442c7fc8c24e6e418b90b62e

Carthag Tuek fucked around with this message at 02:53 on Apr 25, 2013

lord funk
Feb 16, 2004

Doh004 posted:

:woop: Me too. I'm going to fight you, literally, for my ticket.

ultramiraculous posted:

Goon fistycuffs at dawn Friday.

Good luck internet outage to you both!

HookShot
Dec 26, 2005
I have a pretty newbie question, I'm building really basic babby apps right now.

I made an app which had an image, which, when clicked, changes to another image. It works perfectly, and I'm happy with it.

The problem is, I'm trying to make it more difficult by having one image (1.jpg), which clicks to change to another image (2.jpg), but then when you click it again it changes to a third image (3.jpg).

Basically I created an outlet for my button. Then I made an action called imageChange. I coded it to change the image, calling my action clickButton and it works fine. Then what I did was create a second action for the same button, calling it clickAgain. The problem is, when I build my app now, it goes through both of them at once, so I end up basically skipping the second image. As soon as I press down it acts on clickButton, but then immediately acts on clickAgain too, so image 1.jpg basically just goes straight to 3.jpg.

What do I need to do (or Google, I haven't got a clue what to even look for here) to change this? Do I have to add an action so that after clickButton is done it shouldn't do anything else until another Touch Down command is done? Is there something else?

Thanks, thread!

Juc66
Nov 20, 2005
Lord of The Pants

HookShot posted:

I have a pretty newbie question, I'm building really basic babby apps right now.

I made an app which had an image, which, when clicked, changes to another image. It works perfectly, and I'm happy with it.

The problem is, I'm trying to make it more difficult by having one image (1.jpg), which clicks to change to another image (2.jpg), but then when you click it again it changes to a third image (3.jpg).

Basically I created an outlet for my button. Then I made an action called imageChange. I coded it to change the image, calling my action clickButton and it works fine. Then what I did was create a second action for the same button, calling it clickAgain. The problem is, when I build my app now, it goes through both of them at once, so I end up basically skipping the second image. As soon as I press down it acts on clickButton, but then immediately acts on clickAgain too, so image 1.jpg basically just goes straight to 3.jpg.

What do I need to do (or Google, I haven't got a clue what to even look for here) to change this? Do I have to add an action so that after clickButton is done it shouldn't do anything else until another Touch Down command is done? Is there something else?

Thanks, thread!

So why not just have one action.

Track how many times it has been clicked. and if it has been clicked 0 times you switch it to image 2 (and incriment how many times it has been clicked), and if has been clicked any other amount of times it switches to image 3.

you can use ifs or a switch to have any arbitrary number of image clicks you want, and you still only need the click action and the one imageChange thingy as well.

HookShot
Dec 26, 2005

Juc66 posted:

So why not just have one action.

Track how many times it has been clicked. and if it has been clicked 0 times you switch it to image 2 (and incriment how many times it has been clicked), and if has been clicked any other amount of times it switches to image 3.

you can use ifs or a switch to have any arbitrary number of image clicks you want, and you still only need the click action and the one imageChange thingy as well.

Awesome, thank you!!

Adbot
ADBOT LOVES YOU

Doc Block
Apr 15, 2003
Fun Shoe
There isn't really anything you can do to make it not execute all the actions at once.

Like HookShot said, just have your one method ("action") keep track of how many times the button has been tapped, and use the appropriate image based on that.

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