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
modig
Aug 20, 2002

KuruMonkey posted:

Can anyone recommend a getting started / introduction tutorial to XCode that refers to either of the currently available versions of XCode? (I don't care which)

Its actually quite an initial hurdle when even the Hello, World examples in my books keep refering to elements of XCode that have been moved/renamed/removed - even the type of beginning application template they refer to is no longer available, and there's nothing that seems to match up.

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.

modig fucked around with this message at 15:42 on Apr 21, 2011

Adbot
ADBOT LOVES YOU

modig
Aug 20, 2002
Ohh ok, so I need to put it in a .mm file I guess. I'll mess with that later today, thanks.

modig
Aug 20, 2002
Is there any way to simulate video input in the iOS simulator? I'm trying to process video data using <AVCaptureVideoDataOutputSampleBufferDelegate>, and I think I finally got the Delegate setup somewhat. I tried just adding an NSLog call to the captureOutput:didOutputSampleBuffer:fromConnection: function, but it doesn't seem to be called ever. It's quite possible something else is still messed up, but I'd be more confident with the simulating if I could have some video input (I'd see it playback since I currently have a preview layer setup).

modig
Aug 20, 2002

Thanks, still wrapping my head around the basics.

modig
Aug 20, 2002
I'm getting a linker error when I try to call [AVCaptureSession alloc], and I don't understand why. I have copied the exact call from an example program I downloaded, and it works when I run that program. I imported all stuff that was imported in the example program.

CaptureSessionController.h
code:
#import <CoreMedia/CoreMedia.h>
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>


@interface CaptureSessionController : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate> {
    
}

@property (retain) AVCaptureSession *captureSession;
@property (retain) AVCaptureConnection *captureConnection;
@property dispatch_queue_t dQueue;



- (void) StartSession;
- (void) captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection;


@end
CaptureSessionController.m
code:
#import "CaptureSessionController.h"


@implementation CaptureSessionController

@synthesize dQueue;
@synthesize captureSession, captureConnection;


+ (id)init {
	if ((self = [super init])) {
		[self setCaptureSession:[[AVCaptureSession alloc] init]];
	}
	return self;
}
some other methods that don't do anything yet (everything is commented out inside them)
The error:
code:
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_AVCaptureSession", referenced from:
      objc-class-ref in CaptureSessionController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

modig
Aug 20, 2002

Doc Block posted:

Make sure you've got the right frameworks added to the project.

I had no idea what this meant, but googled around and figured it out. Thanks.

Useless rant:
I loving thought thats what the #import command was for... why didn't it just say "hey you cant loving import that, its not part of the project".

modig
Aug 20, 2002
So I signed up for the iOS Developer Program, and I got an email that said I can finish enrollment, but I actually can't. I emailed Apple support on Friday and have yet to get any response. I was planning to test my App on my iPhone this weekend, but I guess that's not going to happen.

edit: Can I access the readings from the ambient light sensors in the iPhone?

I'm pretty sure I can't, so I'm trying to figure out how to use the video camera to measure the light level by basically taking the average value of the pixels in a video frame. So far I'm planning to use captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection to get frames as they come in, but I'm having a hard time figuring out how to access and average the pixel rgb values in a CMSampleBufferRef.

modig fucked around with this message at 06:34 on Apr 24, 2011

modig
Aug 20, 2002
^^ Sorry no idea ^^

Does the TV out in the simulator just not work or something? Every time I activate it my App quits back to the main iPhone screen and the debugger says "Terminating in response to SpringBoard's termination.
"

It's not just my App, I downloaded the "Touches" sample code App and the same thing happens with that. I also commented out the internals of all the functions that have anything to do with adding a new screen, and the same thing happens.

modig
Aug 20, 2002

OHIO posted:

Have you tried having the TV out open in the simulator before starting your app?

I just tried this. I don't have my app setup to look for the TV out when it starts up yet, so it doesn't test much. But it loads up OK, then if you disable the TV out it crashes with that same springboard error. Same behavior in the touches App which doesn't do anything with the TV out.


Here are some basic questions:

code:
@synthesize window=_window;
What does the _window mean? How is it different from not having an underscore?

As far as memory management goes, the guidelines seem to be that I should release any object I own. What does it mean for me to own it? I'm guessing that if I call the alloc function directly, I probably own it. Also I guess any @property with retain counts. What else counts as me owning it?

modig
Aug 20, 2002

Nybble posted:

It seems like from Modig's experience, it can take some time anyway. (Also, I'm impatient)


I signed up on Thursday, my account was enabled sometime Sunday. Late enough that I didn't feel like figuring out how to provision my iPhone for actual testing, so I haven't done that yet.

modig
Aug 20, 2002

OHIO posted:

Have you tried having the TV out open in the simulator before starting your app?

Now I've actually done this, and it seems to work so far. Thanks.

So now I need to assign a view to the second display. Should I create a new ViewController for the second display? Then if I want to have the second display respond to say a button press on the iPhone's ViewController, should I message the AppDelegate and have the AppDelegate message the second view controller? That seems sort of inefficient. Currently the window (iPhone) and secondWindow (TV) are properties of the AppDelegate. Maybe I should pass the secondWindow (or at least it's view property?) object to the primary ViewController?

modig
Aug 20, 2002

OHIO posted:

What do you want to do with the second display?


I made a separate ViewController for the external display, I'll see how that goes. I don't need to do much, just show some static elements and change their colors, and maybe a progress bar. I want the best level of timing control I can get between changes to the external display and the rest of my app. Is there any way to know when a frame is actually output over hdmi or component, vs when I change something in the View?

modig
Aug 20, 2002

Ender.uNF posted:

Only in the sense that you can get the frame rate. There is no way to know if there is a delay in the TV, receiver, etc... Though that is rare on most equipment these days.

I don't need to know when it shows up on the TV, just when it was sent to the TV. I assume the frame rate will be 60fps out, but I'm not even sure if that is true.

modig
Aug 20, 2002
Can I set the exposure of the camera directly? I can lock it so it doesn't change with
code:
        [device setExposureMode:AVCaptureExposureModeLocked];
and I can kind of set it based on part of the field of view using
code:
        device.exposurePointOfInterest = some GCPoint;
        [device setExposureMode:AVCaptureExposureModeAutoExpose;
But how do I say exposureTime=2ms or whatever I want it to be? I'm pretty sure Camera+ does this since you can adjust the exposure by sliding two fingers around, so it is probably possible. I might even settle for just knowing what the exposure setting is at any given time, my best guess currently is to time how long it takes to take a picture.

The question has been asked but remains unanswered on StackOverflow:
http://stackoverflow.com/questions/4745270/can-the-exposure-time-be-manually-adjusted-for-an-ios-cameras

edit: Thanks Ender.unF, CADisplayLink looks perfect.

modig fucked around with this message at 04:08 on Apr 30, 2011

modig
Aug 20, 2002

Bob Morales posted:

Is there a quick blog post or guide to setting up your own buttons for a simple game? I just want 'right', 'left', 'rotate', and 'drop'.

I'm under the assumption that I can't (or shouldn't) use UIKit because I made my own view and I'm just drawing crap to that with Quartz2D, mostly just using my awesome sprite function hooked up to a timer:

code:
-(void) drawSprite:(int) spriteImage x:(int) x y:(int) y {
	CGContextRef context = UIGraphicsGetCurrentContext();
	CGContextSaveGState(context);
	
	[bug[spriteImage] drawInRect:CGRectMake(x, y, BZ_SPRITE_WIDTH, BZ_SPRITE_HEIGHT)];
	
	CGContextRestoreGState(context);
}
I was thinking I would just make 4 images (well maybe 8, one to use while the button is 'down') for each button and draw them every frame. Then just handle the touch events for my view, figure out which button is touched and do whatever from there. Would it be best to write some sort of function that returns a button ID instead of putting the same screen location detection in each function?

This is probably useless to you, but why are you using that rather than just using CoreAnimation and UIImageView?

modig
Aug 20, 2002

kitten smoothie posted:

This is a reply that's a week late, but I signed up as an individual so I could test on my device and then had my account converted to a company account when I was ready to sell stuff. Took only about a week to change it over and I just had to fax over a copy of the incorporation certificate I got from the state to document the company.

Should I not sell an App as an individual?

modig
Aug 20, 2002
Is anybody comfortable sharing some sales numbers/experience, roughly speaking?

modig
Aug 20, 2002
Can somebody show me how to make an NSArray with random integers in it using arc4random()? Or explain what data type I should be using and give me some example code on how to make it?

I tried

code:
NSArray varname = [[NSArray alloc] initWithObjects: arc4random(), arc4random(), nil];

and 

NSInteger a = arc4random()%6;

NSArray varname = [[NSArray alloc] initWithObjects: a, a, nil];
In both cases I get an error about implicit conversion to type id. I know this is a super basic error, I just don't understand typing in objective c at all. The only examples I can find online using NSArray all deal with holding a bunch of string objects. I just want a few numbers to represent dice rolls. I would use a normal c array but I couldn't get that to work and found someone who said that isn't part of objective c. The only other math I'll need after this is comparisons and to be able to sort the array by numerical value.

Adbot
ADBOT LOVES YOU

modig
Aug 20, 2002
Sorry wrong thread, ignore this post.

modig fucked around with this message at 02:46 on Apr 4, 2012

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