First commit
This commit is contained in:
BIN
Classes/06-magnify.png
Normal file
BIN
Classes/06-magnify.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Classes/06-magnify@2x.png
Normal file
BIN
Classes/06-magnify@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
Classes/07-map-marker.png
Normal file
BIN
Classes/07-map-marker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Classes/07-map-marker@2x.png
Normal file
BIN
Classes/07-map-marker@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
89
Classes/AccelerometerFilter.h
Executable file
89
Classes/AccelerometerFilter.h
Executable file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
File: AccelerometerFilter.h
|
||||
Abstract: Implements a low and high pass filter with optional adaptive filtering.
|
||||
Version: 2.5
|
||||
|
||||
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
|
||||
Inc. ("Apple") in consideration of your agreement to the following
|
||||
terms, and your use, installation, modification or redistribution of
|
||||
this Apple software constitutes acceptance of these terms. If you do
|
||||
not agree with these terms, please do not use, install, modify or
|
||||
redistribute this Apple software.
|
||||
|
||||
In consideration of your agreement to abide by the following terms, and
|
||||
subject to these terms, Apple grants you a personal, non-exclusive
|
||||
license, under Apple's copyrights in this original Apple software (the
|
||||
"Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
Software, with or without modifications, in source and/or binary forms;
|
||||
provided that if you redistribute the Apple Software in its entirety and
|
||||
without modifications, you must retain this notice and the following
|
||||
text and disclaimers in all such redistributions of the Apple Software.
|
||||
Neither the name, trademarks, service marks or logos of Apple Inc. may
|
||||
be used to endorse or promote products derived from the Apple Software
|
||||
without specific prior written permission from Apple. Except as
|
||||
expressly stated in this notice, no other rights or licenses, express or
|
||||
implied, are granted by Apple herein, including but not limited to any
|
||||
patent rights that may be infringed by your derivative works or by other
|
||||
works in which the Apple Software may be incorporated.
|
||||
|
||||
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
|
||||
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Copyright (C) 2010 Apple Inc. All Rights Reserved.
|
||||
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
// Basic filter object.
|
||||
@interface AccelerometerFilter : NSObject
|
||||
{
|
||||
BOOL adaptive;
|
||||
UIAccelerationValue x, y, z;
|
||||
}
|
||||
|
||||
// Add a UIAcceleration to the filter.
|
||||
-(void)addAcceleration:(UIAcceleration*)accel;
|
||||
|
||||
@property(nonatomic, readonly) UIAccelerationValue x;
|
||||
@property(nonatomic, readonly) UIAccelerationValue y;
|
||||
@property(nonatomic, readonly) UIAccelerationValue z;
|
||||
|
||||
@property(nonatomic, getter=isAdaptive) BOOL adaptive;
|
||||
@property(nonatomic, readonly) NSString *name;
|
||||
|
||||
@end
|
||||
|
||||
// A filter class to represent a lowpass filter
|
||||
@interface LowpassFilter : AccelerometerFilter
|
||||
{
|
||||
double filterConstant;
|
||||
UIAccelerationValue lastX, lastY, lastZ;
|
||||
}
|
||||
|
||||
-(id)initWithSampleRate:(double)rate cutoffFrequency:(double)freq;
|
||||
|
||||
@end
|
||||
|
||||
// A filter class to represent a highpass filter.
|
||||
@interface HighpassFilter : AccelerometerFilter
|
||||
{
|
||||
double filterConstant;
|
||||
UIAccelerationValue lastX, lastY, lastZ;
|
||||
}
|
||||
|
||||
-(id)initWithSampleRate:(double)rate cutoffFrequency:(double)freq;
|
||||
|
||||
@end
|
||||
164
Classes/AccelerometerFilter.m
Executable file
164
Classes/AccelerometerFilter.m
Executable file
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
File: AccelerometerFilter.m
|
||||
Abstract: Implements a low and high pass filter with optional adaptive filtering.
|
||||
Version: 2.5
|
||||
|
||||
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
|
||||
Inc. ("Apple") in consideration of your agreement to the following
|
||||
terms, and your use, installation, modification or redistribution of
|
||||
this Apple software constitutes acceptance of these terms. If you do
|
||||
not agree with these terms, please do not use, install, modify or
|
||||
redistribute this Apple software.
|
||||
|
||||
In consideration of your agreement to abide by the following terms, and
|
||||
subject to these terms, Apple grants you a personal, non-exclusive
|
||||
license, under Apple's copyrights in this original Apple software (the
|
||||
"Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
Software, with or without modifications, in source and/or binary forms;
|
||||
provided that if you redistribute the Apple Software in its entirety and
|
||||
without modifications, you must retain this notice and the following
|
||||
text and disclaimers in all such redistributions of the Apple Software.
|
||||
Neither the name, trademarks, service marks or logos of Apple Inc. may
|
||||
be used to endorse or promote products derived from the Apple Software
|
||||
without specific prior written permission from Apple. Except as
|
||||
expressly stated in this notice, no other rights or licenses, express or
|
||||
implied, are granted by Apple herein, including but not limited to any
|
||||
patent rights that may be infringed by your derivative works or by other
|
||||
works in which the Apple Software may be incorporated.
|
||||
|
||||
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
|
||||
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Copyright (C) 2010 Apple Inc. All Rights Reserved.
|
||||
|
||||
*/
|
||||
|
||||
#import "AccelerometerFilter.h"
|
||||
|
||||
// Implementation of the basic filter. All it does is mirror input to output.
|
||||
|
||||
@implementation AccelerometerFilter
|
||||
|
||||
@synthesize x, y, z, adaptive;
|
||||
|
||||
-(void)addAcceleration:(UIAcceleration*)accel
|
||||
{
|
||||
x = accel.x;
|
||||
y = accel.y;
|
||||
z = accel.z;
|
||||
}
|
||||
|
||||
-(NSString*)name
|
||||
{
|
||||
return @"You should not see this";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#define kAccelerometerMinStep 0.02
|
||||
#define kAccelerometerNoiseAttenuation 3.0
|
||||
|
||||
double Norm(double x, double y, double z)
|
||||
{
|
||||
return sqrt(x * x + y * y + z * z);
|
||||
}
|
||||
|
||||
double Clamp(double v, double min, double max)
|
||||
{
|
||||
if(v > max)
|
||||
return max;
|
||||
else if(v < min)
|
||||
return min;
|
||||
else
|
||||
return v;
|
||||
}
|
||||
|
||||
// See http://en.wikipedia.org/wiki/Low-pass_filter for details low pass filtering
|
||||
@implementation LowpassFilter
|
||||
|
||||
-(id)initWithSampleRate:(double)rate cutoffFrequency:(double)freq
|
||||
{
|
||||
self = [super init];
|
||||
if(self != nil)
|
||||
{
|
||||
double dt = 1.0 / rate;
|
||||
double RC = 1.0 / freq;
|
||||
filterConstant = dt / (dt + RC);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)addAcceleration:(UIAcceleration*)accel
|
||||
{
|
||||
double alpha = filterConstant;
|
||||
|
||||
if(adaptive)
|
||||
{
|
||||
double d = Clamp(fabs(Norm(x, y, z) - Norm(accel.x, accel.y, accel.z)) / kAccelerometerMinStep - 1.0, 0.0, 1.0);
|
||||
alpha = (1.0 - d) * filterConstant / kAccelerometerNoiseAttenuation + d * filterConstant;
|
||||
}
|
||||
|
||||
x = accel.x * alpha + x * (1.0 - alpha);
|
||||
y = accel.y * alpha + y * (1.0 - alpha);
|
||||
z = accel.z * alpha + z * (1.0 - alpha);
|
||||
}
|
||||
|
||||
-(NSString*)name
|
||||
{
|
||||
return adaptive ? @"Adaptive Lowpass Filter" : @"Lowpass Filter";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
// See http://en.wikipedia.org/wiki/High-pass_filter for details on high pass filtering
|
||||
@implementation HighpassFilter
|
||||
|
||||
-(id)initWithSampleRate:(double)rate cutoffFrequency:(double)freq
|
||||
{
|
||||
self = [super init];
|
||||
if(self != nil)
|
||||
{
|
||||
double dt = 1.0 / rate;
|
||||
double RC = 1.0 / freq;
|
||||
filterConstant = RC / (dt + RC);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)addAcceleration:(UIAcceleration*)accel
|
||||
{
|
||||
double alpha = filterConstant;
|
||||
|
||||
if(adaptive)
|
||||
{
|
||||
double d = Clamp(fabs(Norm(x, y, z) - Norm(accel.x, accel.y, accel.z)) / kAccelerometerMinStep - 1.0, 0.0, 1.0);
|
||||
alpha = d * filterConstant / kAccelerometerNoiseAttenuation + (1.0 - d) * filterConstant;
|
||||
}
|
||||
|
||||
x = alpha * (x + accel.x - lastX);
|
||||
y = alpha * (y + accel.y - lastY);
|
||||
z = alpha * (z + accel.z - lastZ);
|
||||
|
||||
lastX = accel.x;
|
||||
lastY = accel.y;
|
||||
lastZ = accel.z;
|
||||
}
|
||||
|
||||
-(NSString*)name
|
||||
{
|
||||
return adaptive ? @"Adaptive Highpass Filter" : @"Highpass Filter";
|
||||
}
|
||||
|
||||
@end
|
||||
29
Classes/Classes-1.moved-aside/CoreLocationController.h
Executable file
29
Classes/Classes-1.moved-aside/CoreLocationController.h
Executable file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// CoreLocationController.h
|
||||
// CoreLocationDemo
|
||||
//
|
||||
// Created by Nicholas Vellios on 8/15/10.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
|
||||
@protocol CoreLocationControllerDelegate
|
||||
@required
|
||||
|
||||
- (void)locationUpdate:(CLLocation *)location;
|
||||
- (void)locationError:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface CoreLocationController : NSObject <CLLocationManagerDelegate> {
|
||||
CLLocationManager *locMgr;
|
||||
id delegate;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) CLLocationManager *locMgr;
|
||||
@property (nonatomic, assign) id delegate;
|
||||
|
||||
@end
|
||||
44
Classes/Classes-1.moved-aside/CoreLocationController.m
Executable file
44
Classes/Classes-1.moved-aside/CoreLocationController.m
Executable file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// CoreLocationController.m
|
||||
// CoreLocationDemo
|
||||
//
|
||||
// Created by Nicholas Vellios on 8/15/10.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CoreLocationController.h"
|
||||
|
||||
|
||||
@implementation CoreLocationController
|
||||
|
||||
@synthesize locMgr, delegate;
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
|
||||
if(self != nil) {
|
||||
self.locMgr = [[[CLLocationManager alloc] init] autorelease];
|
||||
self.locMgr.delegate = self;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
|
||||
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) {
|
||||
[self.delegate locationUpdate:newLocation];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
|
||||
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) {
|
||||
[self.delegate locationError:error];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.locMgr release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
89
Classes/Classes/AccelerometerFilter.h
Executable file
89
Classes/Classes/AccelerometerFilter.h
Executable file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
File: AccelerometerFilter.h
|
||||
Abstract: Implements a low and high pass filter with optional adaptive filtering.
|
||||
Version: 2.5
|
||||
|
||||
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
|
||||
Inc. ("Apple") in consideration of your agreement to the following
|
||||
terms, and your use, installation, modification or redistribution of
|
||||
this Apple software constitutes acceptance of these terms. If you do
|
||||
not agree with these terms, please do not use, install, modify or
|
||||
redistribute this Apple software.
|
||||
|
||||
In consideration of your agreement to abide by the following terms, and
|
||||
subject to these terms, Apple grants you a personal, non-exclusive
|
||||
license, under Apple's copyrights in this original Apple software (the
|
||||
"Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
Software, with or without modifications, in source and/or binary forms;
|
||||
provided that if you redistribute the Apple Software in its entirety and
|
||||
without modifications, you must retain this notice and the following
|
||||
text and disclaimers in all such redistributions of the Apple Software.
|
||||
Neither the name, trademarks, service marks or logos of Apple Inc. may
|
||||
be used to endorse or promote products derived from the Apple Software
|
||||
without specific prior written permission from Apple. Except as
|
||||
expressly stated in this notice, no other rights or licenses, express or
|
||||
implied, are granted by Apple herein, including but not limited to any
|
||||
patent rights that may be infringed by your derivative works or by other
|
||||
works in which the Apple Software may be incorporated.
|
||||
|
||||
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
|
||||
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Copyright (C) 2010 Apple Inc. All Rights Reserved.
|
||||
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
// Basic filter object.
|
||||
@interface AccelerometerFilter : NSObject
|
||||
{
|
||||
BOOL adaptive;
|
||||
UIAccelerationValue x, y, z;
|
||||
}
|
||||
|
||||
// Add a UIAcceleration to the filter.
|
||||
-(void)addAcceleration:(UIAcceleration*)accel;
|
||||
|
||||
@property(nonatomic, readonly) UIAccelerationValue x;
|
||||
@property(nonatomic, readonly) UIAccelerationValue y;
|
||||
@property(nonatomic, readonly) UIAccelerationValue z;
|
||||
|
||||
@property(nonatomic, getter=isAdaptive) BOOL adaptive;
|
||||
@property(nonatomic, readonly) NSString *name;
|
||||
|
||||
@end
|
||||
|
||||
// A filter class to represent a lowpass filter
|
||||
@interface LowpassFilter : AccelerometerFilter
|
||||
{
|
||||
double filterConstant;
|
||||
UIAccelerationValue lastX, lastY, lastZ;
|
||||
}
|
||||
|
||||
-(id)initWithSampleRate:(double)rate cutoffFrequency:(double)freq;
|
||||
|
||||
@end
|
||||
|
||||
// A filter class to represent a highpass filter.
|
||||
@interface HighpassFilter : AccelerometerFilter
|
||||
{
|
||||
double filterConstant;
|
||||
UIAccelerationValue lastX, lastY, lastZ;
|
||||
}
|
||||
|
||||
-(id)initWithSampleRate:(double)rate cutoffFrequency:(double)freq;
|
||||
|
||||
@end
|
||||
164
Classes/Classes/AccelerometerFilter.m
Executable file
164
Classes/Classes/AccelerometerFilter.m
Executable file
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
File: AccelerometerFilter.m
|
||||
Abstract: Implements a low and high pass filter with optional adaptive filtering.
|
||||
Version: 2.5
|
||||
|
||||
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
|
||||
Inc. ("Apple") in consideration of your agreement to the following
|
||||
terms, and your use, installation, modification or redistribution of
|
||||
this Apple software constitutes acceptance of these terms. If you do
|
||||
not agree with these terms, please do not use, install, modify or
|
||||
redistribute this Apple software.
|
||||
|
||||
In consideration of your agreement to abide by the following terms, and
|
||||
subject to these terms, Apple grants you a personal, non-exclusive
|
||||
license, under Apple's copyrights in this original Apple software (the
|
||||
"Apple Software"), to use, reproduce, modify and redistribute the Apple
|
||||
Software, with or without modifications, in source and/or binary forms;
|
||||
provided that if you redistribute the Apple Software in its entirety and
|
||||
without modifications, you must retain this notice and the following
|
||||
text and disclaimers in all such redistributions of the Apple Software.
|
||||
Neither the name, trademarks, service marks or logos of Apple Inc. may
|
||||
be used to endorse or promote products derived from the Apple Software
|
||||
without specific prior written permission from Apple. Except as
|
||||
expressly stated in this notice, no other rights or licenses, express or
|
||||
implied, are granted by Apple herein, including but not limited to any
|
||||
patent rights that may be infringed by your derivative works or by other
|
||||
works in which the Apple Software may be incorporated.
|
||||
|
||||
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
||||
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
||||
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
||||
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
||||
|
||||
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
||||
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
||||
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
||||
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Copyright (C) 2010 Apple Inc. All Rights Reserved.
|
||||
|
||||
*/
|
||||
|
||||
#import "AccelerometerFilter.h"
|
||||
|
||||
// Implementation of the basic filter. All it does is mirror input to output.
|
||||
|
||||
@implementation AccelerometerFilter
|
||||
|
||||
@synthesize x, y, z, adaptive;
|
||||
|
||||
-(void)addAcceleration:(UIAcceleration*)accel
|
||||
{
|
||||
x = accel.x;
|
||||
y = accel.y;
|
||||
z = accel.z;
|
||||
}
|
||||
|
||||
-(NSString*)name
|
||||
{
|
||||
return @"You should not see this";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#define kAccelerometerMinStep 0.02
|
||||
#define kAccelerometerNoiseAttenuation 3.0
|
||||
|
||||
double Norm(double x, double y, double z)
|
||||
{
|
||||
return sqrt(x * x + y * y + z * z);
|
||||
}
|
||||
|
||||
double Clamp(double v, double min, double max)
|
||||
{
|
||||
if(v > max)
|
||||
return max;
|
||||
else if(v < min)
|
||||
return min;
|
||||
else
|
||||
return v;
|
||||
}
|
||||
|
||||
// See http://en.wikipedia.org/wiki/Low-pass_filter for details low pass filtering
|
||||
@implementation LowpassFilter
|
||||
|
||||
-(id)initWithSampleRate:(double)rate cutoffFrequency:(double)freq
|
||||
{
|
||||
self = [super init];
|
||||
if(self != nil)
|
||||
{
|
||||
double dt = 1.0 / rate;
|
||||
double RC = 1.0 / freq;
|
||||
filterConstant = dt / (dt + RC);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)addAcceleration:(UIAcceleration*)accel
|
||||
{
|
||||
double alpha = filterConstant;
|
||||
|
||||
if(adaptive)
|
||||
{
|
||||
double d = Clamp(fabs(Norm(x, y, z) - Norm(accel.x, accel.y, accel.z)) / kAccelerometerMinStep - 1.0, 0.0, 1.0);
|
||||
alpha = (1.0 - d) * filterConstant / kAccelerometerNoiseAttenuation + d * filterConstant;
|
||||
}
|
||||
|
||||
x = accel.x * alpha + x * (1.0 - alpha);
|
||||
y = accel.y * alpha + y * (1.0 - alpha);
|
||||
z = accel.z * alpha + z * (1.0 - alpha);
|
||||
}
|
||||
|
||||
-(NSString*)name
|
||||
{
|
||||
return adaptive ? @"Adaptive Lowpass Filter" : @"Lowpass Filter";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
// See http://en.wikipedia.org/wiki/High-pass_filter for details on high pass filtering
|
||||
@implementation HighpassFilter
|
||||
|
||||
-(id)initWithSampleRate:(double)rate cutoffFrequency:(double)freq
|
||||
{
|
||||
self = [super init];
|
||||
if(self != nil)
|
||||
{
|
||||
double dt = 1.0 / rate;
|
||||
double RC = 1.0 / freq;
|
||||
filterConstant = RC / (dt + RC);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)addAcceleration:(UIAcceleration*)accel
|
||||
{
|
||||
double alpha = filterConstant;
|
||||
|
||||
if(adaptive)
|
||||
{
|
||||
double d = Clamp(fabs(Norm(x, y, z) - Norm(accel.x, accel.y, accel.z)) / kAccelerometerMinStep - 1.0, 0.0, 1.0);
|
||||
alpha = d * filterConstant / kAccelerometerNoiseAttenuation + (1.0 - d) * filterConstant;
|
||||
}
|
||||
|
||||
x = alpha * (x + accel.x - lastX);
|
||||
y = alpha * (y + accel.y - lastY);
|
||||
z = alpha * (z + accel.z - lastZ);
|
||||
|
||||
lastX = accel.x;
|
||||
lastY = accel.y;
|
||||
lastZ = accel.z;
|
||||
}
|
||||
|
||||
-(NSString*)name
|
||||
{
|
||||
return adaptive ? @"Adaptive Highpass Filter" : @"Highpass Filter";
|
||||
}
|
||||
|
||||
@end
|
||||
29
Classes/Classes/Classes-1.moved-aside/CoreLocationController.h
Executable file
29
Classes/Classes/Classes-1.moved-aside/CoreLocationController.h
Executable file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// CoreLocationController.h
|
||||
// CoreLocationDemo
|
||||
//
|
||||
// Created by Nicholas Vellios on 8/15/10.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
|
||||
@protocol CoreLocationControllerDelegate
|
||||
@required
|
||||
|
||||
- (void)locationUpdate:(CLLocation *)location;
|
||||
- (void)locationError:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface CoreLocationController : NSObject <CLLocationManagerDelegate> {
|
||||
CLLocationManager *locMgr;
|
||||
id delegate;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) CLLocationManager *locMgr;
|
||||
@property (nonatomic, assign) id delegate;
|
||||
|
||||
@end
|
||||
44
Classes/Classes/Classes-1.moved-aside/CoreLocationController.m
Executable file
44
Classes/Classes/Classes-1.moved-aside/CoreLocationController.m
Executable file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// CoreLocationController.m
|
||||
// CoreLocationDemo
|
||||
//
|
||||
// Created by Nicholas Vellios on 8/15/10.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CoreLocationController.h"
|
||||
|
||||
|
||||
@implementation CoreLocationController
|
||||
|
||||
@synthesize locMgr, delegate;
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
|
||||
if(self != nil) {
|
||||
self.locMgr = [[[CLLocationManager alloc] init] autorelease];
|
||||
self.locMgr.delegate = self;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
|
||||
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) {
|
||||
[self.delegate locationUpdate:newLocation];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
|
||||
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) {
|
||||
[self.delegate locationError:error];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.locMgr release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
27
Classes/Classes/CoreLocationController.h
Executable file
27
Classes/Classes/CoreLocationController.h
Executable file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// CoreLocationController.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 15-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
|
||||
@protocol CoreLocationControllerDelegate
|
||||
@required
|
||||
- (void)locationUpdate:(CLLocation *)location; // Our location updates are sent here
|
||||
- (void)locationError:(NSError *)error; // Any errors are sent here
|
||||
@end
|
||||
|
||||
|
||||
@interface CoreLocationController : NSObject <CLLocationManagerDelegate> {
|
||||
CLLocationManager *locMgr;
|
||||
id delegate;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) CLLocationManager *locMgr;
|
||||
@property (nonatomic, assign) id delegate;
|
||||
|
||||
@end
|
||||
44
Classes/Classes/CoreLocationController.m
Executable file
44
Classes/Classes/CoreLocationController.m
Executable file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// CoreLocationController.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 15-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CoreLocationController.h"
|
||||
|
||||
|
||||
@implementation CoreLocationController
|
||||
@synthesize locMgr, delegate;
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
|
||||
if(self != nil) {
|
||||
self.locMgr = [[[CLLocationManager alloc] init] autorelease]; // Create new instance of locMgr
|
||||
self.locMgr.delegate = self; // Set the delegate as self.
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
|
||||
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) { // Check if the class assigning itself as the delegate conforms to our protocol. If not, the message will go nowhere. Not good.
|
||||
[self.delegate locationUpdate:newLocation];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
|
||||
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) { // Check if the class assigning itself as the delegate conforms to our protocol. If not, the message will go nowhere. Not good.
|
||||
[self.delegate locationError:error];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.locMgr release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
39
Classes/Classes/MyCLController.h
Executable file
39
Classes/Classes/MyCLController.h
Executable file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// MyCLController.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 21-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol MyCLControllerDelegate
|
||||
@required
|
||||
- (void)locationUpdate:(CLLocation *)location;
|
||||
- (void)headingUpdate:(CLHeading *)heading;
|
||||
|
||||
- (void)locationError:(NSError *)error;
|
||||
@end
|
||||
|
||||
|
||||
@interface MyCLController : NSObject <CLLocationManagerDelegate> {
|
||||
CLLocationManager *locationManager;
|
||||
id delegate;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) CLLocationManager *locationManager;
|
||||
@property (nonatomic, assign) id delegate;
|
||||
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager
|
||||
didUpdateToLocation:(CLLocation *)newLocation
|
||||
fromLocation:(CLLocation *)oldLocation;
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager
|
||||
didFailWithError:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
70
Classes/Classes/MyCLController.m
Executable file
70
Classes/Classes/MyCLController.m
Executable file
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// MyCLController.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 21-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MyCLController.h"
|
||||
|
||||
@implementation MyCLController
|
||||
|
||||
@synthesize locationManager;
|
||||
@synthesize delegate;
|
||||
|
||||
- (id) init {
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
|
||||
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
|
||||
self.locationManager.delegate = self; // send loc updates to myself
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager
|
||||
didUpdateToLocation:(CLLocation *)newLocation
|
||||
fromLocation:(CLLocation *)oldLocation
|
||||
{
|
||||
|
||||
[self.delegate locationUpdate:newLocation];
|
||||
}
|
||||
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
|
||||
{
|
||||
|
||||
[self.delegate headingUpdate:newHeading];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager {
|
||||
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(locationManagerShouldDisplayHeadingCalibration:)]) {
|
||||
|
||||
return [self.delegate locationManagerShouldDisplayHeadingCalibration:manager];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager
|
||||
didFailWithError:(NSError *)error
|
||||
{
|
||||
[self.delegate locationError:error];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[self.locationManager release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
37
Classes/Classes/MySingleton.h
Executable file
37
Classes/Classes/MySingleton.h
Executable file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// MySingleton.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-02-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface MySingleton : NSObject {
|
||||
NSString *objectkeuze;
|
||||
float rechteklimminguur;
|
||||
float rechteklimmingminuut;
|
||||
float declinatieuur;
|
||||
float declinatieminuut;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@property (nonatomic, retain) NSString* objectkeuze;
|
||||
|
||||
@property(nonatomic, assign) float rechteklimminguur;
|
||||
@property(nonatomic, assign) float rechteklimmingminuut;
|
||||
@property(nonatomic, assign) float declinatieuur;
|
||||
@property(nonatomic, assign) float declinatieminuut;
|
||||
|
||||
|
||||
|
||||
|
||||
+(MySingleton*)sharedMySingleton;
|
||||
-(void)haalObjectGegevensOp ;
|
||||
|
||||
|
||||
@end
|
||||
1053
Classes/Classes/MySingleton.m
Executable file
1053
Classes/Classes/MySingleton.m
Executable file
File diff suppressed because it is too large
Load Diff
23
Classes/Classes/OrientationAppDelegate.h
Executable file
23
Classes/Classes/OrientationAppDelegate.h
Executable file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@class OrientationViewController;
|
||||
|
||||
@interface OrientationAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
|
||||
UIWindow *window;
|
||||
IBOutlet UITabBarController *tabBarController;
|
||||
|
||||
OrientationViewController *viewController;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIWindow *window;
|
||||
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
|
||||
@property (nonatomic, retain) IBOutlet OrientationViewController *viewController;
|
||||
|
||||
@end
|
||||
|
||||
45
Classes/Classes/OrientationAppDelegate.m
Executable file
45
Classes/Classes/OrientationAppDelegate.m
Executable file
@@ -0,0 +1,45 @@
|
||||
#import "OrientationAppDelegate.h"
|
||||
#import "OrientationViewController.h"
|
||||
#import "ZoekformulierViewController.h"
|
||||
|
||||
|
||||
|
||||
@implementation OrientationAppDelegate
|
||||
|
||||
@synthesize window;
|
||||
@synthesize viewController;
|
||||
@synthesize tabBarController;
|
||||
|
||||
|
||||
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
||||
|
||||
// Override point for customization after app launch
|
||||
[window addSubview:viewController.view];
|
||||
[window addSubview:tabBarController.view];
|
||||
|
||||
|
||||
|
||||
[window makeKeyAndVisible];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[tabBarController release];
|
||||
[viewController release];
|
||||
[window release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
39
Classes/Classes/OrientationViewController.h
Executable file
39
Classes/Classes/OrientationViewController.h
Executable file
@@ -0,0 +1,39 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "MyCLController.h"
|
||||
#import "MySingleton.h"
|
||||
|
||||
|
||||
|
||||
@interface OrientationViewController : UIViewController
|
||||
<UIAccelerometerDelegate, MyCLControllerDelegate, UITabBarDelegate> {
|
||||
MyCLController *locationController;
|
||||
IBOutlet UITabBar *tabBar;
|
||||
IBOutlet UILabel *alt;
|
||||
IBOutlet UILabel *az;
|
||||
IBOutlet UILabel *objalt;
|
||||
IBOutlet UILabel *objaz;
|
||||
IBOutlet UILabel *latLabel;
|
||||
IBOutlet UILabel *longLabel;
|
||||
IBOutlet UILabel *timeLabel;
|
||||
IBOutlet UILabel *radecinfoLabel;
|
||||
IBOutlet UILabel *objectlabel;
|
||||
IBOutlet UILabel *objinfoLabel;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@property (nonatomic, retain) UILabel *alt;
|
||||
@property (nonatomic, retain) UILabel *az;
|
||||
@property (nonatomic, retain) UILabel *objalt;
|
||||
@property (nonatomic, retain) UILabel *objaz;
|
||||
@property (nonatomic, retain) UILabel *latLabel;
|
||||
@property (nonatomic, retain) UILabel *longLabel;
|
||||
@property (nonatomic, retain) UILabel *timeLabel;
|
||||
@property (nonatomic, retain) UILabel *radecinfoLabel;
|
||||
@property (nonatomic, retain) UILabel *objinfoLabel;
|
||||
@property (nonatomic, retain) UILabel *objectlabel;
|
||||
|
||||
|
||||
@end
|
||||
442
Classes/Classes/OrientationViewController.m
Executable file
442
Classes/Classes/OrientationViewController.m
Executable file
@@ -0,0 +1,442 @@
|
||||
|
||||
#import "OrientationViewController.h"
|
||||
#import "ZoekFormulierViewController.h"
|
||||
|
||||
@implementation OrientationViewController
|
||||
|
||||
|
||||
@synthesize alt;
|
||||
@synthesize az;
|
||||
@synthesize objalt;
|
||||
@synthesize objaz;
|
||||
@synthesize latLabel;
|
||||
@synthesize longLabel;
|
||||
@synthesize timeLabel;
|
||||
@synthesize radecinfoLabel;
|
||||
@synthesize objectlabel;
|
||||
@synthesize objinfoLabel;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (id) init {
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
}
|
||||
return self;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark UIAccelerometerDelegate
|
||||
|
||||
- (void)accelerometer:(UIAccelerometer *)accelerometer
|
||||
didAccelerate:(UIAcceleration *)acceleration {
|
||||
|
||||
|
||||
UIAccelerationValue x, y, z;
|
||||
|
||||
x = acceleration.x;
|
||||
y = acceleration.y;
|
||||
z = acceleration.z;
|
||||
|
||||
float degrees = ((z * 90) +90);
|
||||
|
||||
|
||||
// De altitude laten zien op scherm
|
||||
|
||||
alt.text = [NSString stringWithFormat:@"%.2f", degrees];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*
|
||||
// The designated initializer. Override to perform setup that is required before the view is loaded.
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
|
||||
// Custom initialization
|
||||
}
|
||||
return self;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Implement loadView to create a view hierarchy programmatically, without using a nib.
|
||||
- (void)loadView {
|
||||
}
|
||||
*/
|
||||
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
|
||||
|
||||
locationController = [[MyCLController alloc] init];
|
||||
locationController.delegate = self;
|
||||
tabBar.delegate = self;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[locationController.locationManager startUpdatingLocation];
|
||||
[locationController.locationManager startUpdatingHeading];
|
||||
|
||||
// Kost wat meer batterij, maar precisie boven alles.
|
||||
locationController.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
|
||||
locationController.locationManager.headingFilter = kCLHeadingFilterNone;
|
||||
|
||||
UIAccelerometer *accelerometer = [UIAccelerometer sharedAccelerometer];
|
||||
accelerometer.delegate = self;
|
||||
|
||||
// Terugzetten naar 0.5 voor productie!
|
||||
|
||||
accelerometer.updateInterval = 0.5; // twice per second
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc that aren't in use.
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
// Release any retained subviews of the main view.
|
||||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)locationUpdate:(CLLocation *)location {
|
||||
|
||||
NSString *strUren;
|
||||
NSString *strMinuten;
|
||||
NSString *strJaar;
|
||||
NSString *strMaand;
|
||||
NSString *strDag;
|
||||
NSString *strObjectinfo;
|
||||
|
||||
|
||||
double latit, longit, lst, rechteklimming, declinatie, uurhoek, dag, maand, uren, minuten,jaar, maanddagen, dagdagen ;
|
||||
double rechteklimminguur, rechteklimmingminuut, declinatieuur, declinatieminuut, dagenj2000, dectijd, tijdut;
|
||||
double HARad, DECRad, ALTRad,AZ,LatRad, sinALT, ALT, cosAZ,AZ11,AZ12,sinAZ,AZ21,AZ22;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// We gebruiken een singleton object (globale variabele om de objectkeuze van de andere tab door te geven)
|
||||
|
||||
|
||||
strObjectinfo=[MySingleton sharedMySingleton].objectkeuze;
|
||||
|
||||
|
||||
[MySingleton sharedMySingleton].haalObjectGegevensOp;
|
||||
|
||||
|
||||
rechteklimminguur=[MySingleton sharedMySingleton].rechteklimminguur;
|
||||
rechteklimmingminuut=[MySingleton sharedMySingleton].rechteklimmingminuut;
|
||||
declinatieuur=[MySingleton sharedMySingleton].declinatieuur;
|
||||
declinatieminuut=[MySingleton sharedMySingleton].declinatieminuut;
|
||||
|
||||
|
||||
|
||||
// Laat zien op scherm
|
||||
|
||||
NSString *radecinfo = [NSString stringWithFormat:@"RA %.0f h, %.0f min, DEC %.0f h, %.0f min",rechteklimminguur,rechteklimmingminuut, declinatieuur, declinatieminuut];
|
||||
|
||||
radecinfoLabel.text = radecinfo;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (strObjectinfo==NULL) strObjectinfo=@"Please Choose";
|
||||
|
||||
objectlabel.text=strObjectinfo;
|
||||
|
||||
|
||||
|
||||
|
||||
// conversie naar decimalen
|
||||
|
||||
rechteklimming= rechteklimminguur + (rechteklimmingminuut/60) ;
|
||||
rechteklimming = rechteklimming *15;
|
||||
declinatie= declinatieuur + (declinatieminuut/60);
|
||||
|
||||
// NSLog(@"rechteklimming %f", rechteklimming);
|
||||
// NSLog(@"declinatie object %f", declinatie);
|
||||
|
||||
|
||||
// opslaan huidige locatie voor berekenening
|
||||
|
||||
latit = location.coordinate.latitude;
|
||||
longit= location.coordinate.longitude;
|
||||
|
||||
|
||||
// We werken in UTC
|
||||
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"];
|
||||
[formatter setTimeZone:timeZone];
|
||||
|
||||
|
||||
// Dag grabben
|
||||
[formatter setDateFormat:@"dd"];
|
||||
strDag= [formatter stringFromDate:location.timestamp];
|
||||
|
||||
// Maand grabben
|
||||
[formatter setDateFormat:@"mm"];
|
||||
strMaand= [formatter stringFromDate:location.timestamp];
|
||||
|
||||
|
||||
// Uren grabben
|
||||
[formatter setDateFormat:@"HH"];
|
||||
strUren= [formatter stringFromDate:location.timestamp];
|
||||
|
||||
// Minuten grabben
|
||||
[formatter setDateFormat:@"mm"];
|
||||
strMinuten= [formatter stringFromDate:location.timestamp];
|
||||
|
||||
// Jaar grabben
|
||||
[formatter setDateFormat:@"yyyy"];
|
||||
strJaar= [formatter stringFromDate:location.timestamp];
|
||||
|
||||
|
||||
// Converteer string naar float
|
||||
|
||||
|
||||
dag = [strDag floatValue];
|
||||
maand = [strMaand floatValue];
|
||||
uren = [strUren floatValue];
|
||||
minuten = [strMinuten floatValue];
|
||||
jaar = [strJaar floatValue];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Aantal dagen sinds epoch 2000 berekenen
|
||||
|
||||
// Maak van uren+minuten een decimaal
|
||||
dectijd =uren + (minuten/60);
|
||||
dectijd = dectijd/24;
|
||||
|
||||
|
||||
// vervang deze harde waarden door een array of database!!!
|
||||
|
||||
|
||||
/*
|
||||
Table A | Table B
|
||||
Days to beginning of | Days since J2000 to
|
||||
month | beginning of each year
|
||||
|
|
||||
Month Normal Leap | Year Days | Year Days
|
||||
year year | |
|
||||
| |
|
||||
Jan 0 0 | 1998 -731.5 | 2010 3651.5
|
||||
Feb 31 31 | 1999 -366.5 | 2011 4016.5
|
||||
Mar 59 60 | 2000 -1.5 | 2012 4381.5
|
||||
Apr 90 91 | 2001 364.5 | 2013 4747.5
|
||||
May 120 121 | 2002 729.5 | 2014 5112.5
|
||||
Jun 151 152 | 2003 1094.5 | 2015 5477.5
|
||||
Jul 181 182 | 2004 1459.5 | 2016 5842.5
|
||||
Aug 212 213 | 2005 1825.5 | 2017 6208.5
|
||||
Sep 243 244 | 2006 2190.5 | 2018 6573.5
|
||||
Oct 273 274 | 2007 2555.5 | 2019 6938.5
|
||||
Nov 304 305 | 2008 2920.5 | 2020 7303.5
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// in een array plaatsen!
|
||||
maanddagen= 31; // Aantal dagen sinds begin van het jaar Augustus in een niet-schrikkeljaar
|
||||
|
||||
|
||||
NSLog(@"log: %@ ", strJaar);
|
||||
|
||||
if (strJaar==@"2011") dagdagen=4016.5;
|
||||
if (strJaar==@"2012") dagdagen=4016.5;
|
||||
if (strJaar==@"2013") dagdagen=4016.5;
|
||||
if (strJaar==@"2014") dagdagen=4016.5;
|
||||
if (strJaar==@"2015") dagdagen=4016.5;
|
||||
if (strJaar==@"2016") dagdagen=4016.5;
|
||||
if (strJaar==@"2017") dagdagen=4016.5;
|
||||
if (strJaar==@"2018") dagdagen=4016.5;
|
||||
|
||||
|
||||
|
||||
dagdagen=4016.5; // Aantal dagen sinds 01-01-2000 tot begin van het jaar
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// optellen en aantal dagen bepalen sinds 01-01-2000 0:00
|
||||
|
||||
dagenj2000=dectijd+maanddagen+dag+dagdagen;
|
||||
|
||||
// NSLog(@"dagen sinds 2000 %f", dagenj2000);
|
||||
|
||||
|
||||
// Local Siderial Time
|
||||
|
||||
|
||||
// UT tijd berekenen
|
||||
tijdut =uren + (minuten/60);
|
||||
|
||||
lst = 100.46 + 0.985647 * dagenj2000 + longit + 15*tijdut ;
|
||||
|
||||
// modulusberekening. Cocoa doet alleen INT op modulus
|
||||
lst = lst - (floor(lst/ 360) *360);
|
||||
|
||||
|
||||
|
||||
// NSLog(@"tijdUT %f", tijdut);
|
||||
// NSLog(@"long %f", longit);
|
||||
// NSLog(@"lst %f", lst);
|
||||
|
||||
|
||||
|
||||
// Uurhoek berekenen. Als uurhoek <0 360 erbij optellen.
|
||||
|
||||
|
||||
uurhoek = lst - rechteklimming;
|
||||
if (uurhoek<0){
|
||||
uurhoek=uurhoek+360;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// NSLog(@"Uurhoek %f", uurhoek);
|
||||
|
||||
|
||||
// CONVERSIE RA/DEC --> ALTAZ
|
||||
|
||||
// Converteer graden naar radians;
|
||||
|
||||
HARad= (uurhoek*M_PI)/180;
|
||||
DECRad = (declinatie*M_PI)/180;
|
||||
LatRad = (latit*M_PI)/180;
|
||||
|
||||
sinALT = sin(DECRad) * sin(LatRad) + cos(DECRad)* cos(LatRad)* cos(HARad);
|
||||
ALTRad = asin(sinALT) ;
|
||||
ALT = ALTRad * 180/M_PI;
|
||||
cosAZ = (sin(DECRad)* cos(LatRad)- cos(DECRad)*cos(HARad)* sin(LatRad))/ cos(ALTRad) ;
|
||||
AZ11 = (acos(cosAZ)) * 180/M_PI ;
|
||||
AZ12 = 360 - AZ11 ;
|
||||
sinAZ = (-cos(DECRad)*sin(HARad))/cos(ALTRad);
|
||||
AZ21 = (asin(sinAZ)) * 180/M_PI ;
|
||||
if (AZ21 >=0 ) {AZ22 = 180 - AZ21 ;} else { AZ22 = 360 - AZ21 ; } ;
|
||||
if ((abs(AZ11-AZ21) <= 0.0001)||(abs(AZ11-AZ22) <= 0.0001)){
|
||||
AZ = AZ11 ;
|
||||
}else {AZ = AZ12 ;}
|
||||
|
||||
// NSLog(@"objaz %f", AZ);
|
||||
// NSLog(@"objalt %f", ALT);
|
||||
|
||||
|
||||
// SCHERMOUTPUT
|
||||
|
||||
|
||||
// Object Alt/az laten zien (berekend uit RADEC);
|
||||
|
||||
objalt.text = [NSString stringWithFormat:@"%.2f", ALT];
|
||||
objaz.text = [NSString stringWithFormat:@"%.2f", AZ];
|
||||
|
||||
|
||||
// Laat lat en Lon zien op scherm
|
||||
latLabel.text = [NSString stringWithFormat:@"Lat: %l.2f", location.coordinate.latitude];
|
||||
longLabel.text = [NSString stringWithFormat:@"Lon: %l.2f", location.coordinate.longitude];
|
||||
|
||||
// TijdLabel op scherm (terugconverteren naar GMT+1)
|
||||
|
||||
timeZone = [NSTimeZone timeZoneWithName:@"GMT+1"];
|
||||
[formatter setTimeZone:timeZone];
|
||||
|
||||
[formatter setDateFormat:@"HH:mm"];
|
||||
strUren= [formatter stringFromDate:location.timestamp];
|
||||
timeLabel.text= strUren;
|
||||
|
||||
// releases
|
||||
formatter.release;
|
||||
}
|
||||
|
||||
- (void)headingUpdate:(CLHeading *)heading {
|
||||
|
||||
|
||||
|
||||
|
||||
// If the accuracy is valid, process the event.
|
||||
|
||||
if (heading.headingAccuracy > 0)
|
||||
|
||||
{
|
||||
|
||||
az.text = [NSString stringWithFormat:@"%.2f", heading.trueHeading];
|
||||
|
||||
|
||||
// Do something with the event data.
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)locationError:(NSError *)error {
|
||||
latLabel.text = [error description];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[locationController release];
|
||||
[tabBar release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
30
Classes/Classes/ZoekFormulierViewController.h
Executable file
30
Classes/Classes/ZoekFormulierViewController.h
Executable file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// ZoekFormulierViewController.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-02-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@interface ZoekFormulierViewController : UIViewController < UITableViewDataSource, UITableViewDelegate> {
|
||||
UITableView *mainTableView;
|
||||
NSMutableArray *contentsList;
|
||||
NSMutableArray *searchResults;
|
||||
NSString *savedSearchTerm;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UITableView *mainTableView;
|
||||
@property (nonatomic, retain) NSMutableArray *contentsList;
|
||||
@property (nonatomic, retain) NSMutableArray *searchResults;
|
||||
@property (nonatomic, copy) NSString *savedSearchTerm;
|
||||
|
||||
- (void)handleSearchForTerm:(NSString *)searchTerm;
|
||||
|
||||
@end
|
||||
280
Classes/Classes/ZoekFormulierViewController.m
Executable file
280
Classes/Classes/ZoekFormulierViewController.m
Executable file
@@ -0,0 +1,280 @@
|
||||
//
|
||||
// ZoekFormulierViewController.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-02-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ZoekFormulierViewController.h"
|
||||
#import "MySingleton.h"
|
||||
|
||||
|
||||
@implementation ZoekFormulierViewController
|
||||
|
||||
|
||||
@synthesize mainTableView;
|
||||
@synthesize contentsList;
|
||||
@synthesize searchResults;
|
||||
@synthesize savedSearchTerm;
|
||||
|
||||
|
||||
|
||||
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
|
||||
/*
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization.
|
||||
}
|
||||
return self;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Override to allow orientations other than the default portrait orientation.
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// Return YES for supported orientations.
|
||||
return (interfaceOrientation == UIInterfaceOrientationPortrait);
|
||||
}
|
||||
*/
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc. that aren't in use.
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
|
||||
[super viewDidLoad];
|
||||
|
||||
NSMutableArray *array = [[NSMutableArray alloc] initWithObjects:
|
||||
@"M1", @"M2", @"M3", @"M4", @"M5", @"M6", @"M7", @"M8", @"M9", @"M10",
|
||||
@"M11", @"M12", @"M13", @"M14", @"M15", @"M16", @"M17", @"M18", @"M19",
|
||||
@"M20", @"M21", @"M22", @"M23", @"M24", @"M25", @"M26", @"M27", @"M28", @"M29",
|
||||
@"M30", @"M31", @"M32", @"M33", @"M34", @"M35", @"M36", @"M37", @"M38", @"M39",
|
||||
@"M40", @"M41", @"M42", @"M43", @"M44", @"M45", @"M46", @"M47", @"M48", @"M49",
|
||||
@"M50", @"M51", @"M52", @"M53", @"M54", @"M55", @"M56", @"M57", @"M58", @"M59",
|
||||
@"M60", @"M61", @"M62", @"M63", @"M64", @"M65", @"M66", @"M67", @"M68", @"M69",
|
||||
@"M70", @"M71", @"M72", @"M73", @"M74", @"M75", @"M76", @"M77", @"M78", @"M79",
|
||||
@"M80", @"M81", @"M82", @"M83", @"M84", @"M85", @"M86", @"M87", @"M88", @"M89",
|
||||
@"M90", @"M91", @"M92", @"M93", @"M94", @"M95", @"M96", @"M97", @"M98", @"M99",
|
||||
@"M100", @"M101", @"M102", @"M103", @"M104", @"M105", @"M106", @"M107", @"M108", @"M109", @"M110", nil];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[self setContentsList:array];
|
||||
[array release], array = nil;
|
||||
// Restore search term
|
||||
if ([self savedSearchTerm])
|
||||
{
|
||||
[[[self searchDisplayController] searchBar] setText:[self savedSearchTerm]];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
|
||||
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
[[self mainTableView] reloadData];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)handleSearchForTerm:(NSString *)searchTerm
|
||||
{
|
||||
[self setSavedSearchTerm:searchTerm];
|
||||
|
||||
if ([self searchResults] == nil)
|
||||
{
|
||||
NSMutableArray *array = [[NSMutableArray alloc] init];
|
||||
[self setSearchResults:array];
|
||||
[array release], array = nil;
|
||||
}
|
||||
|
||||
[[self searchResults] removeAllObjects];
|
||||
|
||||
if ([[self savedSearchTerm] length] != 0)
|
||||
{
|
||||
for (NSString *currentString in [self contentsList])
|
||||
{
|
||||
if ([currentString rangeOfString:searchTerm options:NSCaseInsensitiveSearch].location != NSNotFound)
|
||||
{
|
||||
[[self searchResults] addObject:currentString];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
NSInteger rows;
|
||||
|
||||
if (tableView == [[self searchDisplayController] searchResultsTableView])
|
||||
rows = [[self searchResults] count];
|
||||
else
|
||||
rows = [[self contentsList] count];
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void) tableView:(UITableView *) tableView
|
||||
didSelectRowAtIndexPath: (NSIndexPath *) indexPath {
|
||||
|
||||
|
||||
|
||||
UITableViewCell *cell;
|
||||
cell = [tableView cellForRowAtIndexPath:indexPath];
|
||||
|
||||
|
||||
|
||||
[MySingleton sharedMySingleton].objectkeuze = cell.textLabel.text;
|
||||
// RADEC vullen.
|
||||
|
||||
[MySingleton sharedMySingleton].haalObjectGegevensOp;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// [[MySingleton sharedMySingleton] laatObjectzien];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSInteger row = [indexPath row];
|
||||
NSString *contentForThisRow = nil;
|
||||
|
||||
if (tableView == [[self searchDisplayController] searchResultsTableView])
|
||||
contentForThisRow = [[self searchResults] objectAtIndex:row];
|
||||
|
||||
else
|
||||
contentForThisRow = [[self contentsList] objectAtIndex:row];
|
||||
|
||||
static NSString *CellIdentifier = @"CellIdentifier";
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||
if (cell == nil)
|
||||
{
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
|
||||
}
|
||||
|
||||
[[cell textLabel] setText:contentForThisRow];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller
|
||||
{
|
||||
[self setSavedSearchTerm:nil];
|
||||
|
||||
[[self mainTableView] reloadData];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller
|
||||
shouldReloadTableForSearchString:(NSString *)searchString
|
||||
{
|
||||
[self handleSearchForTerm:searchString];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)viewDidUnload
|
||||
{
|
||||
[super viewDidUnload];
|
||||
|
||||
// Save the state of the search UI so that it can be restored if the view is re-created.
|
||||
[self setSavedSearchTerm:[[[self searchDisplayController] searchBar] text]];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[self setSearchResults:nil];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
|
||||
|
||||
|
||||
|
||||
[mainTableView release], mainTableView = nil;
|
||||
[contentsList release], contentsList = nil;
|
||||
|
||||
[searchResults release], searchResults = nil;
|
||||
[savedSearchTerm release], savedSearchTerm = nil;
|
||||
|
||||
[super dealloc];
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
601
Classes/Classes/ZoekFormulierViewController.xib
Executable file
601
Classes/Classes/ZoekFormulierViewController.xib
Executable file
@@ -0,0 +1,601 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1056</int>
|
||||
<string key="IBDocument.SystemVersion">10J567</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">823</string>
|
||||
<string key="IBDocument.AppKitVersion">1038.35</string>
|
||||
<string key="IBDocument.HIToolboxVersion">462.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">132</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="23"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUITableView" id="600119369">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUISearchBar" id="947254156">
|
||||
<reference key="NSNextResponder" ref="600119369"/>
|
||||
<int key="NSvFlags">290</int>
|
||||
<string key="NSFrameSize">{320, 44}</string>
|
||||
<reference key="NSSuperview" ref="600119369"/>
|
||||
<int key="IBUIContentMode">3</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="IBUITextInputTraits" key="IBTextInputTraits">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUITableView" id="854932400">
|
||||
<reference key="NSNextResponder" ref="600119369"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUISearchBar" id="848138976">
|
||||
<reference key="NSNextResponder" ref="854932400"/>
|
||||
<int key="NSvFlags">290</int>
|
||||
<string key="NSFrameSize">{320, 44}</string>
|
||||
<reference key="NSSuperview" ref="854932400"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC41MjcxNzM5MTMgMCAwAA</bytes>
|
||||
</object>
|
||||
<int key="IBUIContentMode">3</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSColor" key="IBTintColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC41MjcxNzM5MTMgMCAwAA</bytes>
|
||||
</object>
|
||||
<object class="IBUITextInputTraits" key="IBTextInputTraits">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{320, 542}</string>
|
||||
<reference key="NSSuperview" ref="600119369"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC41MjcxNzM5MTMgMCAwAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<float key="IBUIAlpha">0.76760566234588623</float>
|
||||
<string key="IBUIContentStretch">{{0, 0}, {0, 0}}</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIAlwaysBounceVertical">YES</bool>
|
||||
<float key="IBUIMinimumZoomScale">0.0</float>
|
||||
<float key="IBUIMaximumZoomScale">0.0</float>
|
||||
<int key="IBUISeparatorStyle">1</int>
|
||||
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
|
||||
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
|
||||
<float key="IBUIRowHeight">44</float>
|
||||
<float key="IBUISectionHeaderHeight">22</float>
|
||||
<float key="IBUISectionFooterHeight">22</float>
|
||||
<reference key="IBUITableHeaderView" ref="848138976"/>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{320, 542}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIAlwaysBounceVertical">YES</bool>
|
||||
<int key="IBUISeparatorStyle">1</int>
|
||||
<int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
|
||||
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
|
||||
<float key="IBUIRowHeight">44</float>
|
||||
<float key="IBUISectionHeaderHeight">22</float>
|
||||
<float key="IBUISectionFooterHeight">22</float>
|
||||
<reference key="IBUITableHeaderView" ref="947254156"/>
|
||||
<reference key="IBUITableFooterView" ref="854932400"/>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{320, 460}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUISearchDisplayController" id="406061483">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">mainTableView</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="600119369"/>
|
||||
</object>
|
||||
<int key="connectionID">5</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="600119369"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">9</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="600119369"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">10</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchBar</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="947254156"/>
|
||||
</object>
|
||||
<int key="connectionID">14</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchDisplayController</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="406061483"/>
|
||||
</object>
|
||||
<int key="connectionID">15</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchContentsController</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">16</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchResultsDataSource</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">17</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchResultsDelegate</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">18</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">19</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="947254156"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">20</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="854932400"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">25</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="854932400"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">26</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="848138976"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">27</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<reference key="object" ref="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="600119369"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="600119369"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="947254156"/>
|
||||
<reference ref="854932400"/>
|
||||
</object>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">12</int>
|
||||
<reference key="object" ref="947254156"/>
|
||||
<reference key="parent" ref="600119369"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">13</int>
|
||||
<reference key="object" ref="406061483"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">23</int>
|
||||
<reference key="object" ref="854932400"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="848138976"/>
|
||||
</object>
|
||||
<reference key="parent" ref="600119369"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">24</int>
|
||||
<reference key="object" ref="848138976"/>
|
||||
<reference key="parent" ref="854932400"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>1.IBEditorWindowLastContentRect</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>12.IBPluginDependency</string>
|
||||
<string>23.IBPluginDependency</string>
|
||||
<string>23.IBViewBoundsToFrameTransform</string>
|
||||
<string>24.IBPluginDependency</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
<string>4.IBViewBoundsToFrameTransform</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>ZoekFormulierViewController</string>
|
||||
<string>UIResponder</string>
|
||||
<string>{{484, 488}, {320, 480}}</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<object class="NSAffineTransform"/>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<object class="NSAffineTransform">
|
||||
<bytes key="NSTransformStruct">P4AAAL+AAAAAAAAAxAcAAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">27</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">ZoekFormulierViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">mainTableView</string>
|
||||
<string key="NS.object.0">UITableView</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">mainTableView</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">mainTableView</string>
|
||||
<string key="candidateClassName">UITableView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">Classes/ZoekFormulierViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSError.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIAccessibility.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UINibLoading.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier" id="1038572612">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIResponder</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<reference key="sourceIdentifier" ref="1038572612"/>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIScrollView</string>
|
||||
<string key="superclassName">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIScrollView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UISearchBar</string>
|
||||
<string key="superclassName">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UISearchBar.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UISearchDisplayController</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UISearchDisplayController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UITableView</string>
|
||||
<string key="superclassName">UIScrollView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UITableView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIPrintFormatter.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UITextField.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIView</string>
|
||||
<string key="superclassName">UIResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UINavigationController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIPopoverController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UISplitViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UITabBarController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIViewController</string>
|
||||
<string key="superclassName">UIResponder</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBFrameworkSource</string>
|
||||
<string key="minorKey">UIKit.framework/Headers/UIViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<integer value="1056" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<string key="IBDocument.LastKnownRelativeProjectPath">../IDSC.xcodeproj</string>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">132</string>
|
||||
</data>
|
||||
</archive>
|
||||
33
Classes/Classes/coordinatetranslator.h
Executable file
33
Classes/Classes/coordinatetranslator.h
Executable file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// coordinatetranslator.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 25-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface coordinatetranslator : NSObject {
|
||||
|
||||
|
||||
|
||||
// NSdate *datum;
|
||||
double Long;
|
||||
double Lat;
|
||||
double Alti;
|
||||
double ALT ;
|
||||
double AZ ;
|
||||
double RA ;
|
||||
double DEC ;
|
||||
char ObjName ;
|
||||
char ObjRef ;
|
||||
char ObjAltName ;
|
||||
char ObjType ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
15
Classes/Classes/coordinatetranslator.m
Executable file
15
Classes/Classes/coordinatetranslator.m
Executable file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// coordinatetranslator.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 25-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "coordinatetranslator.h"
|
||||
|
||||
|
||||
@implementation coordinatetranslator
|
||||
|
||||
@end
|
||||
|
||||
16
Classes/Classes/untitled.h
Executable file
16
Classes/Classes/untitled.h
Executable file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// untitled.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 10-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@interface untitled : UIViewController {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
65
Classes/Classes/untitled.m
Executable file
65
Classes/Classes/untitled.m
Executable file
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// untitled.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 10-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "untitled.h"
|
||||
|
||||
|
||||
@implementation untitled
|
||||
|
||||
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
|
||||
/*
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization.
|
||||
}
|
||||
return self;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Implement loadView to create a view hierarchy programmatically, without using a nib.
|
||||
- (void)loadView {
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Override to allow orientations other than the default portrait orientation.
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// Return YES for supported orientations.
|
||||
return (interfaceOrientation == UIInterfaceOrientationPortrait);
|
||||
}
|
||||
*/
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc. that aren't in use.
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
[super viewDidUnload];
|
||||
// Release any retained subviews of the main view.
|
||||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
27
Classes/CoreLocationController.h
Executable file
27
Classes/CoreLocationController.h
Executable file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// CoreLocationController.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 15-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
|
||||
@protocol CoreLocationControllerDelegate
|
||||
@required
|
||||
- (void)locationUpdate:(CLLocation *)location; // Our location updates are sent here
|
||||
- (void)locationError:(NSError *)error; // Any errors are sent here
|
||||
@end
|
||||
|
||||
|
||||
@interface CoreLocationController : NSObject <CLLocationManagerDelegate> {
|
||||
CLLocationManager *locMgr;
|
||||
id delegate;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) CLLocationManager *locMgr;
|
||||
@property (nonatomic, assign) id delegate;
|
||||
|
||||
@end
|
||||
44
Classes/CoreLocationController.m
Executable file
44
Classes/CoreLocationController.m
Executable file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// CoreLocationController.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 15-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CoreLocationController.h"
|
||||
|
||||
|
||||
@implementation CoreLocationController
|
||||
@synthesize locMgr, delegate;
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
|
||||
if(self != nil) {
|
||||
self.locMgr = [[[CLLocationManager alloc] init] autorelease]; // Create new instance of locMgr
|
||||
self.locMgr.delegate = self; // Set the delegate as self.
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
|
||||
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) { // Check if the class assigning itself as the delegate conforms to our protocol. If not, the message will go nowhere. Not good.
|
||||
[self.delegate locationUpdate:newLocation];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
|
||||
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) { // Check if the class assigning itself as the delegate conforms to our protocol. If not, the message will go nowhere. Not good.
|
||||
[self.delegate locationError:error];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self.locMgr release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
52
Classes/GradientButton.h
Normal file
52
Classes/GradientButton.h
Normal file
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// ButtonGradientView.h
|
||||
// Custom Alert View
|
||||
//
|
||||
// Created by jeff on 5/17/10.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
#import <CoreGraphics/CoreGraphics.h>
|
||||
|
||||
@interface GradientButton : UIButton
|
||||
{
|
||||
// These two arrays define the gradient that will be used
|
||||
// when the button is in UIControlStateNormal
|
||||
NSArray *normalGradientColors; // Colors
|
||||
NSArray *normalGradientLocations; // Relative locations
|
||||
|
||||
// These two arrays define the gradient that will be used
|
||||
// when the button is in UIControlStateHighlighted
|
||||
NSArray *highlightGradientColors; // Colors
|
||||
NSArray *highlightGradientLocations; // Relative locations
|
||||
|
||||
// This defines the corner radius of the button
|
||||
CGFloat cornerRadius;
|
||||
|
||||
// This defines the size and color of the stroke
|
||||
CGFloat strokeWeight;
|
||||
UIColor *strokeColor;
|
||||
|
||||
@private
|
||||
CGGradientRef normalGradient;
|
||||
CGGradientRef highlightGradient;
|
||||
}
|
||||
@property (nonatomic, retain) NSArray *normalGradientColors;
|
||||
@property (nonatomic, retain) NSArray *normalGradientLocations;
|
||||
@property (nonatomic, retain) NSArray *highlightGradientColors;
|
||||
@property (nonatomic, retain) NSArray *highlightGradientLocations;
|
||||
@property (nonatomic) CGFloat cornerRadius;
|
||||
@property (nonatomic) CGFloat strokeWeight;
|
||||
@property (nonatomic, retain) UIColor *strokeColor;
|
||||
- (void)useAlertStyle;
|
||||
- (void)useRedDeleteStyle;
|
||||
- (void)useWhiteStyle;
|
||||
- (void)useBlackStyle;
|
||||
- (void)useWhiteActionSheetStyle;
|
||||
- (void)useBlackActionSheetStyle;
|
||||
- (void)useSimpleOrangeStyle;
|
||||
- (void)useGreenConfirmStyle;
|
||||
|
||||
@end
|
||||
568
Classes/GradientButton.m
Normal file
568
Classes/GradientButton.m
Normal file
@@ -0,0 +1,568 @@
|
||||
//
|
||||
// ButtonGradientView.m
|
||||
// Custom Alert View
|
||||
//
|
||||
// Created by jeff on 5/17/10.
|
||||
// Copyright 2010 __MyCompanyName__. All rights reserved.
|
||||
//
|
||||
|
||||
#import "GradientButton.h"
|
||||
|
||||
@interface GradientButton()
|
||||
@property (nonatomic, readonly) CGGradientRef normalGradient;
|
||||
@property (nonatomic, readonly) CGGradientRef highlightGradient;
|
||||
- (void)hesitateUpdate; // Used to catch and fix problem where quick taps don't get updated back to normal state
|
||||
@end
|
||||
#pragma mark -
|
||||
|
||||
@implementation GradientButton
|
||||
@synthesize normalGradientColors;
|
||||
@synthesize normalGradientLocations;
|
||||
@synthesize highlightGradientColors;
|
||||
@synthesize highlightGradientLocations;
|
||||
@synthesize cornerRadius;
|
||||
@synthesize strokeWeight, strokeColor;
|
||||
@synthesize normalGradient, highlightGradient;
|
||||
#pragma mark -
|
||||
- (CGGradientRef)normalGradient
|
||||
{
|
||||
if (normalGradient == NULL)
|
||||
{
|
||||
int locCount = [normalGradientLocations count];
|
||||
CGFloat locations[locCount];
|
||||
for (int i = 0; i < [normalGradientLocations count]; i++)
|
||||
{
|
||||
NSNumber *location = [normalGradientLocations objectAtIndex:i];
|
||||
locations[i] = [location floatValue];
|
||||
}
|
||||
CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();
|
||||
|
||||
normalGradient = CGGradientCreateWithColors(space, (__bridge_retained CFArrayRef)normalGradientColors, locations);
|
||||
CGColorSpaceRelease(space);
|
||||
}
|
||||
return normalGradient;
|
||||
}
|
||||
- (CGGradientRef)highlightGradient
|
||||
{
|
||||
|
||||
if (highlightGradient == NULL)
|
||||
{
|
||||
CGFloat locations[[highlightGradientLocations count]];
|
||||
for (int i = 0; i < [highlightGradientLocations count]; i++)
|
||||
{
|
||||
NSNumber *location = [highlightGradientLocations objectAtIndex:i];
|
||||
locations[i] = [location floatValue];
|
||||
}
|
||||
CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB();
|
||||
|
||||
highlightGradient = CGGradientCreateWithColors(space, (__bridge_retained CFArrayRef)highlightGradientColors, locations);
|
||||
CGColorSpaceRelease(space);
|
||||
}
|
||||
return highlightGradient;
|
||||
}
|
||||
#pragma mark -
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self)
|
||||
{
|
||||
[self setOpaque:NO];
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark -
|
||||
#pragma mark Appearances
|
||||
- (void)useAlertStyle
|
||||
{
|
||||
// Oddly enough, if I create the color array using arrayWithObjects:, it
|
||||
// doesn't work - the gradient comes back NULL
|
||||
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:3];
|
||||
UIColor *color = [UIColor colorWithRed:0.283 green:0.32 blue:0.414 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.82 green:0.834 blue:0.87 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.186 green:0.223 blue:0.326 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
self.normalGradientColors = colors;
|
||||
self.normalGradientLocations = [NSArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.483f],
|
||||
nil];
|
||||
|
||||
NSMutableArray *colors2 = [NSMutableArray arrayWithCapacity:4];
|
||||
color = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.656 green:0.683 blue:0.713 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.137 green:0.155 blue:0.208 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.237 green:0.257 blue:0.305 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
self.highlightGradientColors = colors2;
|
||||
self.highlightGradientLocations = [NSArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.51f],
|
||||
[NSNumber numberWithFloat:0.654f],
|
||||
nil];
|
||||
self.cornerRadius = 7.0f;
|
||||
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
|
||||
|
||||
}
|
||||
- (void)useRedDeleteStyle
|
||||
{
|
||||
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:5];
|
||||
UIColor *color = [UIColor colorWithRed:0.667 green:0.15 blue:0.152 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.841 green:0.566 blue:0.566 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.75 green:0.341 blue:0.345 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.592 green:0.0 blue:0.0 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.592 green:0.0 blue:0.0 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
self.normalGradientColors = colors;
|
||||
self.normalGradientLocations = [NSArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.582f],
|
||||
[NSNumber numberWithFloat:0.418f],
|
||||
[NSNumber numberWithFloat:0.346],
|
||||
nil];
|
||||
|
||||
NSMutableArray *colors2 = [NSMutableArray arrayWithCapacity:5];
|
||||
color = [UIColor colorWithRed:0.467 green:0.009 blue:0.005 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.754 green:0.562 blue:0.562 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.543 green:0.212 blue:0.212 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.5 green:0.153 blue:0.152 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.388 green:0.004 blue:0.0 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
|
||||
self.highlightGradientColors = colors;
|
||||
self.highlightGradientLocations = [NSArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.715f],
|
||||
[NSNumber numberWithFloat:0.513f],
|
||||
[NSNumber numberWithFloat:0.445f],
|
||||
nil];
|
||||
self.cornerRadius = 9.f;
|
||||
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
|
||||
}
|
||||
- (void)useWhiteStyle
|
||||
{
|
||||
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:3];
|
||||
UIColor *color = [UIColor colorWithRed:0.864 green:0.864 blue:0.864 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.995 green:0.995 blue:0.995 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.956 green:0.956 blue:0.955 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
self.normalGradientColors = colors;
|
||||
self.normalGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.601f],
|
||||
nil];
|
||||
|
||||
NSMutableArray *colors2 = [NSMutableArray arrayWithCapacity:3];
|
||||
color = [UIColor colorWithRed:0.692 green:0.692 blue:0.691 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.995 green:0.995 blue:0.995 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.83 green:0.83 blue:0.83 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
self.highlightGradientColors = colors2;
|
||||
self.highlightGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.601f],
|
||||
nil];
|
||||
|
||||
self.cornerRadius = 9.f;
|
||||
[self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
|
||||
[self setTitleColor:[UIColor darkGrayColor] forState:UIControlStateHighlighted];
|
||||
}
|
||||
- (void)useBlackStyle
|
||||
{
|
||||
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:4];
|
||||
UIColor *color = [UIColor colorWithRed:0.154 green:0.154 blue:0.154 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.307 green:0.307 blue:0.307 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];;
|
||||
color = [UIColor colorWithRed:0.166 green:0.166 blue:0.166 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.118 green:0.118 blue:0.118 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
self.normalGradientColors = colors;
|
||||
self.normalGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.548f],
|
||||
[NSNumber numberWithFloat:0.462f],
|
||||
nil];
|
||||
self.cornerRadius = 9.0f;
|
||||
|
||||
NSMutableArray *colors2 = [NSMutableArray arrayWithCapacity:4];
|
||||
color = [UIColor colorWithRed:0.199 green:0.199 blue:0.199 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.04 green:0.04 blue:0.04 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.074 green:0.074 blue:0.074 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.112 green:0.112 blue:0.112 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
|
||||
self.highlightGradientColors = colors2;
|
||||
self.highlightGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.548f],
|
||||
[NSNumber numberWithFloat:0.462f],
|
||||
nil];
|
||||
[self setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
|
||||
}
|
||||
- (void)useWhiteActionSheetStyle
|
||||
{
|
||||
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:3];
|
||||
UIColor *color = [UIColor colorWithRed:0.864 green:0.864 blue:0.864 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.995 green:0.995 blue:0.995 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.956 green:0.956 blue:0.955 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
self.normalGradientColors = colors;
|
||||
self.normalGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.601f],
|
||||
nil];
|
||||
|
||||
NSMutableArray *colors2 = [NSMutableArray arrayWithCapacity:7];
|
||||
color = [UIColor colorWithRed:0.033 green:0.251 blue:0.673 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.66 green:0.701 blue:0.88 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.222 green:0.308 blue:0.709 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.145 green:0.231 blue:0.683 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.0 green:0.124 blue:0.621 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.011 green:0.181 blue:0.647 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.311 green:0.383 blue:0.748 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
self.highlightGradientColors = colors2;
|
||||
self.highlightGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.957f],
|
||||
[NSNumber numberWithFloat:0.574f],
|
||||
[NSNumber numberWithFloat:0.541],
|
||||
[NSNumber numberWithFloat:0.185f],
|
||||
[NSNumber numberWithFloat:0.812f],
|
||||
nil];
|
||||
|
||||
self.cornerRadius = 9.f;
|
||||
[self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
|
||||
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
|
||||
}
|
||||
- (void)useBlackActionSheetStyle
|
||||
{
|
||||
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:4];
|
||||
UIColor *color = [UIColor colorWithRed:0.154 green:0.154 blue:0.154 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.307 green:0.307 blue:0.307 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];;
|
||||
color = [UIColor colorWithRed:0.166 green:0.166 blue:0.166 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.118 green:0.118 blue:0.118 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
self.normalGradientColors = colors;
|
||||
self.normalGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.548f],
|
||||
[NSNumber numberWithFloat:0.462f],
|
||||
nil];
|
||||
self.cornerRadius = 9.0f;
|
||||
|
||||
NSMutableArray *colors2 = [NSMutableArray arrayWithCapacity:7];
|
||||
color = [UIColor colorWithRed:0.033 green:0.251 blue:0.673 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.66 green:0.701 blue:0.88 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.222 green:0.308 blue:0.709 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.145 green:0.231 blue:0.683 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.0 green:0.124 blue:0.621 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.011 green:0.181 blue:0.647 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.311 green:0.383 blue:0.748 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
self.highlightGradientColors = colors2;
|
||||
self.highlightGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.957f],
|
||||
[NSNumber numberWithFloat:0.574f],
|
||||
[NSNumber numberWithFloat:0.541],
|
||||
[NSNumber numberWithFloat:0.185],
|
||||
[NSNumber numberWithFloat:0.812f],
|
||||
nil];
|
||||
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
|
||||
}
|
||||
- (void)useSimpleOrangeStyle
|
||||
{
|
||||
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:2];
|
||||
UIColor *color = [UIColor colorWithRed:0.935 green:0.403 blue:0.02 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.97 green:0.582 blue:0.0 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
self.normalGradientColors = colors;
|
||||
self.normalGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
nil];
|
||||
|
||||
NSMutableArray *colors2 = [NSMutableArray arrayWithCapacity:3];
|
||||
color = [UIColor colorWithRed:0.914 green:0.309 blue:0.0 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.935 green:0.4 blue:0.0 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.946 green:0.441 blue:0.01 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
self.highlightGradientColors = colors2;
|
||||
self.highlightGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.498f],
|
||||
nil];
|
||||
|
||||
self.cornerRadius = 9.f;
|
||||
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
}
|
||||
- (void)useGreenConfirmStyle
|
||||
{
|
||||
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:5];
|
||||
UIColor *color = [UIColor colorWithRed:0.15 green:0.667 blue:0.152 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.566 green:0.841 blue:0.566 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.341 green:0.75 blue:0.345 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.0 green:0.592 blue:0.0 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.0 green:0.592 blue:0.0 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
self.normalGradientColors = colors;
|
||||
self.normalGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.582f],
|
||||
[NSNumber numberWithFloat:0.418f],
|
||||
[NSNumber numberWithFloat:0.346],
|
||||
nil];
|
||||
|
||||
NSMutableArray *colors2 = [NSMutableArray arrayWithCapacity:5];
|
||||
color = [UIColor colorWithRed:0.009 green:0.467 blue:0.005 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.562 green:0.754 blue:0.562 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.212 green:0.543 blue:0.212 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.153 green:0.5 blue:0.152 alpha:1.0];
|
||||
[colors2 addObject:(id)[color CGColor]];
|
||||
color = [UIColor colorWithRed:0.004 green:0.388 blue:0.0 alpha:1.0];
|
||||
[colors addObject:(id)[color CGColor]];
|
||||
|
||||
self.highlightGradientColors = colors;
|
||||
self.highlightGradientLocations = [NSMutableArray arrayWithObjects:
|
||||
[NSNumber numberWithFloat:0.0f],
|
||||
[NSNumber numberWithFloat:1.0f],
|
||||
[NSNumber numberWithFloat:0.715f],
|
||||
[NSNumber numberWithFloat:0.513f],
|
||||
[NSNumber numberWithFloat:0.445f],
|
||||
nil];
|
||||
self.cornerRadius = 9.f;
|
||||
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
|
||||
}
|
||||
#pragma mark -
|
||||
- (void)drawRect:(CGRect)rect
|
||||
{
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
CGRect imageBounds = CGRectMake(0.0, 0.0, self.bounds.size.width - 0.5, self.bounds.size.height);
|
||||
|
||||
|
||||
CGGradientRef gradient;
|
||||
CGContextRef context = UIGraphicsGetCurrentContext();
|
||||
CGPoint point2;
|
||||
|
||||
CGFloat resolution = 0.5 * (self.bounds.size.width / imageBounds.size.width + self.bounds.size.height / imageBounds.size.height);
|
||||
|
||||
CGFloat stroke = strokeWeight * resolution;
|
||||
if (stroke < 1.0)
|
||||
stroke = ceil(stroke);
|
||||
else
|
||||
stroke = round(stroke);
|
||||
stroke /= resolution;
|
||||
CGFloat alignStroke = fmod(0.5 * stroke * resolution, 1.0);
|
||||
CGMutablePathRef path = CGPathCreateMutable();
|
||||
CGPoint point = CGPointMake((self.bounds.size.width - [self cornerRadius]), self.bounds.size.height - 0.5f);
|
||||
point.x = (round(resolution * point.x + alignStroke) - alignStroke) / resolution;
|
||||
point.y = (round(resolution * point.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPathMoveToPoint(path, NULL, point.x, point.y);
|
||||
point = CGPointMake(self.bounds.size.width - 0.5f, (self.bounds.size.height - [self cornerRadius]));
|
||||
point.x = (round(resolution * point.x + alignStroke) - alignStroke) / resolution;
|
||||
point.y = (round(resolution * point.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPoint controlPoint1 = CGPointMake((self.bounds.size.width - ([self cornerRadius] / 2.f)), self.bounds.size.height - 0.5f);
|
||||
controlPoint1.x = (round(resolution * controlPoint1.x + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint1.y = (round(resolution * controlPoint1.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPoint controlPoint2 = CGPointMake(self.bounds.size.width - 0.5f, (self.bounds.size.height - ([self cornerRadius] / 2.f)));
|
||||
controlPoint2.x = (round(resolution * controlPoint2.x + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint2.y = (round(resolution * controlPoint2.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPathAddCurveToPoint(path, NULL, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, point.x, point.y);
|
||||
point = CGPointMake(self.bounds.size.width - 0.5f, [self cornerRadius]);
|
||||
point.x = (round(resolution * point.x + alignStroke) - alignStroke) / resolution;
|
||||
point.y = (round(resolution * point.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPathAddLineToPoint(path, NULL, point.x, point.y);
|
||||
point = CGPointMake((self.bounds.size.width - [self cornerRadius]), 0.0);
|
||||
point.x = (round(resolution * point.x + alignStroke) - alignStroke) / resolution;
|
||||
point.y = (round(resolution * point.y + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint1 = CGPointMake(self.bounds.size.width - 0.5f, ([self cornerRadius] / 2.f));
|
||||
controlPoint1.x = (round(resolution * controlPoint1.x + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint1.y = (round(resolution * controlPoint1.y + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint2 = CGPointMake((self.bounds.size.width - ([self cornerRadius] / 2.f)), 0.0);
|
||||
controlPoint2.x = (round(resolution * controlPoint2.x + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint2.y = (round(resolution * controlPoint2.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPathAddCurveToPoint(path, NULL, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, point.x, point.y);
|
||||
point = CGPointMake([self cornerRadius], 0.0);
|
||||
point.x = (round(resolution * point.x + alignStroke) - alignStroke) / resolution;
|
||||
point.y = (round(resolution * point.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPathAddLineToPoint(path, NULL, point.x, point.y);
|
||||
point = CGPointMake(0.0, [self cornerRadius]);
|
||||
point.x = (round(resolution * point.x + alignStroke) - alignStroke) / resolution;
|
||||
point.y = (round(resolution * point.y + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint1 = CGPointMake(([self cornerRadius] / 2.f), 0.0);
|
||||
controlPoint1.x = (round(resolution * controlPoint1.x + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint1.y = (round(resolution * controlPoint1.y + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint2 = CGPointMake(0.0, ([self cornerRadius] / 2.f));
|
||||
controlPoint2.x = (round(resolution * controlPoint2.x + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint2.y = (round(resolution * controlPoint2.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPathAddCurveToPoint(path, NULL, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, point.x, point.y);
|
||||
point = CGPointMake(0.0, (self.bounds.size.height - [self cornerRadius]));
|
||||
point.x = (round(resolution * point.x + alignStroke) - alignStroke) / resolution;
|
||||
point.y = (round(resolution * point.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPathAddLineToPoint(path, NULL, point.x, point.y);
|
||||
point = CGPointMake([self cornerRadius], self.bounds.size.height - 0.5f);
|
||||
point.x = (round(resolution * point.x + alignStroke) - alignStroke) / resolution;
|
||||
point.y = (round(resolution * point.y + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint1 = CGPointMake(0.0, (self.bounds.size.height - ([self cornerRadius] / 2.f)));
|
||||
controlPoint1.x = (round(resolution * controlPoint1.x + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint1.y = (round(resolution * controlPoint1.y + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint2 = CGPointMake(([self cornerRadius] / 2.f), self.bounds.size.height - 0.5f);
|
||||
controlPoint2.x = (round(resolution * controlPoint2.x + alignStroke) - alignStroke) / resolution;
|
||||
controlPoint2.y = (round(resolution * controlPoint2.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPathAddCurveToPoint(path, NULL, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, point.x, point.y);
|
||||
point = CGPointMake((self.bounds.size.width - [self cornerRadius]), self.bounds.size.height - 0.5f);
|
||||
point.x = (round(resolution * point.x + alignStroke) - alignStroke) / resolution;
|
||||
point.y = (round(resolution * point.y + alignStroke) - alignStroke) / resolution;
|
||||
CGPathAddLineToPoint(path, NULL, point.x, point.y);
|
||||
CGPathCloseSubpath(path);
|
||||
if (self.state == UIControlStateHighlighted)
|
||||
gradient = self.highlightGradient;
|
||||
else
|
||||
gradient = self.normalGradient;
|
||||
|
||||
CGContextAddPath(context, path);
|
||||
CGContextSaveGState(context);
|
||||
CGContextEOClip(context);
|
||||
point = CGPointMake((self.bounds.size.width / 2.0), self.bounds.size.height - 0.5f);
|
||||
point2 = CGPointMake((self.bounds.size.width / 2.0), 0.0);
|
||||
CGContextDrawLinearGradient(context, gradient, point, point2, (kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation));
|
||||
CGContextRestoreGState(context);
|
||||
[strokeColor setStroke];
|
||||
CGContextSetLineWidth(context, stroke);
|
||||
CGContextSetLineCap(context, kCGLineCapSquare);
|
||||
CGContextAddPath(context, path);
|
||||
CGContextStrokePath(context);
|
||||
CGPathRelease(path);
|
||||
|
||||
}
|
||||
#pragma mark -
|
||||
#pragma mark Touch Handling
|
||||
- (void)hesitateUpdate
|
||||
{
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
[super touchesBegan:touches withEvent:event];
|
||||
[self setNeedsDisplay];
|
||||
}
|
||||
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
[super touchesCancelled:touches withEvent:event];
|
||||
[self setNeedsDisplay];
|
||||
[self performSelector:@selector(hesitateUpdate) withObject:nil afterDelay:0.1];
|
||||
}
|
||||
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
[super touchesMoved:touches withEvent:event];
|
||||
[self setNeedsDisplay];
|
||||
|
||||
}
|
||||
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
|
||||
{
|
||||
[super touchesEnded:touches withEvent:event];
|
||||
[self setNeedsDisplay];
|
||||
[self performSelector:@selector(hesitateUpdate) withObject:nil afterDelay:0.1];
|
||||
}
|
||||
#pragma mark -
|
||||
#pragma mark NSCoding
|
||||
- (void)encodeWithCoder:(NSCoder *)encoder
|
||||
{
|
||||
[super encodeWithCoder:encoder];
|
||||
[encoder encodeObject:[self normalGradientColors] forKey:@"normalGradientColors"];
|
||||
[encoder encodeObject:[self normalGradientLocations] forKey:@"normalGradientLocations"];
|
||||
[encoder encodeObject:[self highlightGradientColors] forKey:@"highlightGradientColors"];
|
||||
[encoder encodeObject:[self highlightGradientLocations] forKey:@"highlightGradientLocations"];
|
||||
}
|
||||
|
||||
- (id)initWithCoder:(NSCoder *)decoder
|
||||
{
|
||||
if (self = [super initWithCoder:decoder])
|
||||
{
|
||||
[self setNormalGradientColors:[decoder decodeObjectForKey:@"normalGradientColors"]];
|
||||
[self setNormalGradientLocations:[decoder decodeObjectForKey:@"normalGradientLocations"]];
|
||||
[self setHighlightGradientColors:[decoder decodeObjectForKey:@"highlightGradientColors"]];
|
||||
[self setHighlightGradientLocations:[decoder decodeObjectForKey:@"highlightGradientLocations"]];
|
||||
self.strokeColor = [UIColor colorWithRed:0.076 green:0.103 blue:0.195 alpha:1.0];
|
||||
self.strokeWeight = 1.0;
|
||||
|
||||
if (self.normalGradientColors == nil)
|
||||
[self useWhiteStyle];
|
||||
|
||||
[self setOpaque:NO];
|
||||
self.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.0];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
#pragma mark -
|
||||
|
||||
|
||||
@end
|
||||
37
Classes/MessierZoekFormulierViewController.h
Executable file
37
Classes/MessierZoekFormulierViewController.h
Executable file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// ZoekFormulierViewController.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-02-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "catalogus.h"
|
||||
|
||||
|
||||
@interface MessierZoekFormulierViewController : UIViewController < UITableViewDataSource, UITableViewDelegate> {
|
||||
UITableView *mainTableView;
|
||||
NSMutableArray *contentsList;
|
||||
NSMutableArray *searchResults;
|
||||
|
||||
NSString *savedSearchTerm;
|
||||
NSString *databaseName;
|
||||
NSString *databasePath;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UITableView *mainTableView;
|
||||
@property (nonatomic, retain) NSMutableArray *contentsList;
|
||||
@property (nonatomic, retain) NSMutableArray *searchResults;
|
||||
@property (nonatomic, retain) NSString *savedSearchTerm;
|
||||
@property (nonatomic, retain) NSString *databaseName, *databasePath;
|
||||
|
||||
|
||||
- (void)handleSearchForTerm:(NSString *)searchTerm;
|
||||
- (void)checkAndCreateDatabase;
|
||||
- (void)readObjectsFromDatabase;
|
||||
|
||||
@end
|
||||
430
Classes/MessierZoekFormulierViewController.m
Executable file
430
Classes/MessierZoekFormulierViewController.m
Executable file
@@ -0,0 +1,430 @@
|
||||
//
|
||||
// ZoekFormulierViewController.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-02-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MessierZoekFormulierViewController.h"
|
||||
#import "MySingleton.h"
|
||||
#import <sqlite3.h>
|
||||
#import "catalogus.h"
|
||||
|
||||
|
||||
@implementation MessierZoekFormulierViewController
|
||||
|
||||
|
||||
@synthesize mainTableView;
|
||||
@synthesize contentsList;
|
||||
@synthesize searchResults;
|
||||
@synthesize savedSearchTerm;
|
||||
@synthesize databaseName, databasePath;
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc. that aren't in use.
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
|
||||
[super viewDidLoad];
|
||||
[self.mainTableView
|
||||
setBackgroundColor:[UIColor blackColor]];
|
||||
|
||||
|
||||
|
||||
UIColor *NightColor=[UIColor colorWithRed:70 green:0 blue:0 alpha:0.8];
|
||||
[self.mainTableView setSeparatorColor:NightColor];
|
||||
|
||||
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
|
||||
databaseName = @"catalogus.sqlite";
|
||||
// Get the path to the documents directory and append the databaseName
|
||||
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
|
||||
NSString *documentsDir = [documentPaths objectAtIndex:0];
|
||||
databasePath = [documentsDir stringByAppendingPathComponent: databaseName];
|
||||
|
||||
|
||||
|
||||
|
||||
[self checkAndCreateDatabase];
|
||||
[self readObjectsFromDatabase];
|
||||
|
||||
|
||||
|
||||
// Deze vervangen voor de databaseversie
|
||||
|
||||
|
||||
|
||||
[self setContentsList:contentsList];
|
||||
|
||||
|
||||
|
||||
// [contentsList release], contentsList = nil;
|
||||
|
||||
|
||||
|
||||
|
||||
// Restore search term
|
||||
if ([self savedSearchTerm])
|
||||
{
|
||||
[[[self searchDisplayController] searchBar] setText:[self savedSearchTerm]];
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
|
||||
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
[[self mainTableView] reloadData];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)handleSearchForTerm:(NSString *)searchTerm
|
||||
{
|
||||
[self setSavedSearchTerm:searchTerm];
|
||||
|
||||
if ([self searchResults] == nil)
|
||||
{
|
||||
NSMutableArray *array = [[NSMutableArray alloc] init];
|
||||
[self setSearchResults:array];
|
||||
array = nil;
|
||||
}
|
||||
|
||||
[[self searchResults] removeAllObjects];
|
||||
|
||||
if ([[self savedSearchTerm] length] != 0)
|
||||
{
|
||||
|
||||
|
||||
|
||||
for (catalogus *zoekcatalogus in [self contentsList]) {
|
||||
|
||||
if ([zoekcatalogus.objectID rangeOfString:searchTerm options:NSCaseInsensitiveSearch].location != NSNotFound)
|
||||
{
|
||||
[[self searchResults] addObject:zoekcatalogus.objectID];
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
NSInteger rows;
|
||||
|
||||
if (tableView == [[self searchDisplayController] searchResultsTableView])
|
||||
rows = [[self searchResults] count];
|
||||
else
|
||||
rows = [[self contentsList] count];
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void) tableView:(UITableView *) tableView
|
||||
didSelectRowAtIndexPath: (NSIndexPath *) indexPath {
|
||||
|
||||
|
||||
|
||||
UITableViewCell *cell;
|
||||
cell = [tableView cellForRowAtIndexPath:indexPath];
|
||||
|
||||
UIView *bgColorView = [[UIView alloc] init];
|
||||
|
||||
UIColor *NightColor=[UIColor colorWithRed:70 green:0 blue:0 alpha:0.8];
|
||||
|
||||
[bgColorView setBackgroundColor:NightColor];
|
||||
[cell setSelectedBackgroundView:bgColorView];
|
||||
|
||||
catalogus *mijnCatalogus = (catalogus *)[self.contentsList objectAtIndex: indexPath.row];
|
||||
// Kommas naar punten
|
||||
|
||||
NSString *RAString = [mijnCatalogus.objectRA stringByReplacingOccurrencesOfString:@"," withString:@"."];
|
||||
NSString *DECString = [mijnCatalogus.objectDec stringByReplacingOccurrencesOfString:@"," withString:@"."];
|
||||
double rechteklimming = [RAString doubleValue];
|
||||
double declinatie = [DECString doubleValue];
|
||||
[MySingleton sharedMySingleton].rechteklimming=rechteklimming;
|
||||
[MySingleton sharedMySingleton].declinatie=declinatie;
|
||||
[MySingleton sharedMySingleton].objectkeuze = mijnCatalogus.objectID;
|
||||
[MySingleton sharedMySingleton].objectMagnitude=mijnCatalogus.objectMagnitude;
|
||||
[MySingleton sharedMySingleton].objectType=mijnCatalogus.objectType;
|
||||
[MySingleton sharedMySingleton].objectSize=mijnCatalogus.objectSize;
|
||||
[MySingleton sharedMySingleton].objectNotes=mijnCatalogus.objectNotes;
|
||||
[MySingleton sharedMySingleton].objectName=mijnCatalogus.objectName;
|
||||
[MySingleton sharedMySingleton].objectConst=mijnCatalogus.objectConstellation;
|
||||
|
||||
if (tableView == [[self searchDisplayController] searchResultsTableView]) {
|
||||
|
||||
|
||||
|
||||
for (catalogus *zoekcatalogus in [self contentsList]) {
|
||||
|
||||
if ([zoekcatalogus.objectID rangeOfString:cell.textLabel.text options:NSCaseInsensitiveSearch].location != NSNotFound)
|
||||
{
|
||||
|
||||
|
||||
NSString *RAString = [zoekcatalogus.objectRA stringByReplacingOccurrencesOfString:@"," withString:@"."];
|
||||
NSString *DECString = [zoekcatalogus.objectDec stringByReplacingOccurrencesOfString:@"," withString:@"."];
|
||||
|
||||
float rechteklimming = [RAString floatValue];
|
||||
float declinatie = [DECString floatValue];
|
||||
|
||||
[MySingleton sharedMySingleton].objectkeuze = zoekcatalogus.objectID;
|
||||
[MySingleton sharedMySingleton].rechteklimming=rechteklimming;
|
||||
[MySingleton sharedMySingleton].declinatie=declinatie;
|
||||
[MySingleton sharedMySingleton].objectMagnitude=zoekcatalogus.objectMagnitude;
|
||||
[MySingleton sharedMySingleton].objectType=zoekcatalogus.objectType;
|
||||
[MySingleton sharedMySingleton].objectSize=zoekcatalogus.objectSize;
|
||||
[MySingleton sharedMySingleton].objectNotes=zoekcatalogus.objectNotes;
|
||||
[MySingleton sharedMySingleton].objectName=zoekcatalogus.objectName;
|
||||
[MySingleton sharedMySingleton].objectConst=zoekcatalogus.objectConstellation;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
NSInteger row = [indexPath row];
|
||||
NSString *contentForThisRow=NULL ;
|
||||
|
||||
|
||||
if (tableView == [[self searchDisplayController] searchResultsTableView]) {
|
||||
contentForThisRow = [[self searchResults] objectAtIndex:row];
|
||||
|
||||
}
|
||||
else {
|
||||
catalogus *mijnCatalogus = (catalogus *)[self.contentsList objectAtIndex: row];
|
||||
contentForThisRow = mijnCatalogus.objectID;
|
||||
}
|
||||
|
||||
|
||||
static NSString *CellIdentifier = @"CellIdentifier";
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||
if (cell == nil)
|
||||
{
|
||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
|
||||
}
|
||||
|
||||
|
||||
UIFont *myFont = [ UIFont fontWithName: @"System" size: 16.0 ];
|
||||
cell.textLabel.font = myFont;
|
||||
// Set up the cell...
|
||||
|
||||
UIColor *NightColor=[UIColor colorWithRed:70 green:0 blue:0 alpha:0.8];
|
||||
|
||||
cell.textLabel.textColor=NightColor;
|
||||
[[cell textLabel] setText:contentForThisRow];
|
||||
|
||||
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller
|
||||
{
|
||||
[self setSavedSearchTerm:nil];
|
||||
|
||||
[[self mainTableView] reloadData];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller
|
||||
shouldReloadTableForSearchString:(NSString *)searchString
|
||||
|
||||
{
|
||||
|
||||
CGFloat nRed=84.0/255.0;
|
||||
CGFloat nBlue=8/255.0;
|
||||
CGFloat nGreen=4.0/255.0;
|
||||
UIColor *nightColor=[[UIColor alloc]initWithRed:nRed green:nBlue blue:nGreen alpha:1];
|
||||
[controller.searchResultsTableView setBackgroundColor:nightColor];
|
||||
controller.searchResultsTableView.bounces=FALSE;
|
||||
|
||||
[self handleSearchForTerm:searchString];
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)viewDidUnload
|
||||
{
|
||||
[super viewDidUnload];
|
||||
|
||||
// Save the state of the search UI so that it can be restored if the view is re-created.
|
||||
[self setSavedSearchTerm:[[[self searchDisplayController] searchBar] text]];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[self setSearchResults:nil];
|
||||
}
|
||||
|
||||
- (void) checkAndCreateDatabase{
|
||||
|
||||
// Check if the SQL database has already been saved to the users phone, if not then copy it over
|
||||
BOOL success;
|
||||
|
||||
// Create a FileManager object, we will use this to check the status
|
||||
// of the database and to copy it over if required
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
|
||||
// Check if the database has already been created in the users filesystem
|
||||
success = [fileManager fileExistsAtPath:databasePath];
|
||||
|
||||
// If the database already exists then return without doing anything
|
||||
if(success) return;
|
||||
|
||||
// If not then proceed to copy the database from the application to the users filesystem
|
||||
|
||||
// Get the path to the database in the application package
|
||||
NSString *databasePathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:databaseName];
|
||||
|
||||
// Copy the database from the package to the users filesystem
|
||||
[fileManager copyItemAtPath:databasePathFromApp toPath:databasePath error:nil];
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void) readObjectsFromDatabase{
|
||||
|
||||
|
||||
// Setup the database object
|
||||
sqlite3 *database;
|
||||
|
||||
contentsList = [[NSMutableArray alloc] init];
|
||||
|
||||
// Open the database from the users filessytem
|
||||
if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {
|
||||
|
||||
// Setup the SQL Statement and compile it for faster access
|
||||
const char *sqlStatement = "select * from messier";
|
||||
|
||||
sqlite3_stmt *compiledStatement;
|
||||
|
||||
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
|
||||
|
||||
// Loop through the results and add them to the feeds array
|
||||
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
|
||||
|
||||
|
||||
|
||||
NSString *bOobjectID = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)];
|
||||
NSString *bobjectName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
|
||||
NSString *bobjectType = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
|
||||
NSString *bobjectRA = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
|
||||
NSString *bobjectDec = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)];
|
||||
NSString *bobjectMagnitude = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 5)];
|
||||
NSString *bobjectSize = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 6)];
|
||||
NSString *bobjectConstellation = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 7)];
|
||||
NSString *bobjectNotes = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 8)];
|
||||
|
||||
|
||||
|
||||
[self.contentsList addObject:[catalogus objectWithID:bOobjectID objectName:bobjectName objectType:bobjectType objectRA:bobjectRA objectDec:bobjectDec objectMagnitude:bobjectMagnitude objectSize:bobjectSize objectConstellation:bobjectConstellation objectNotes:bobjectNotes]];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Release the compiled statement from memory
|
||||
sqlite3_finalize(compiledStatement);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
sqlite3_close(database);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
|
||||
|
||||
|
||||
|
||||
mainTableView = nil;
|
||||
contentsList = nil;
|
||||
|
||||
searchResults = nil;
|
||||
savedSearchTerm = nil;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
311
Classes/MessierZoekFormulierViewController.xib
Executable file
311
Classes/MessierZoekFormulierViewController.xib
Executable file
@@ -0,0 +1,311 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1552</int>
|
||||
<string key="IBDocument.SystemVersion">12D78</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.37</string>
|
||||
<string key="IBDocument.HIToolboxVersion">626.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">2083</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUISearchBar</string>
|
||||
<string>IBUISearchDisplayController</string>
|
||||
<string>IBUITableView</string>
|
||||
<string>IBUIView</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUITableView" id="600119369">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUISearchBar" id="947254156">
|
||||
<reference key="NSNextResponder" ref="600119369"/>
|
||||
<int key="NSvFlags">290</int>
|
||||
<string key="NSFrameSize">{320, 44}</string>
|
||||
<reference key="NSSuperview" ref="600119369"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<int key="IBUIContentMode">3</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSColor" key="IBTintColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC41MjcxNzM5MTMgMCAwAA</bytes>
|
||||
</object>
|
||||
<object class="IBUITextInputTraits" key="IBTextInputTraits">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 2}, {320, 409}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">2</int>
|
||||
<bytes key="NSRGB">MC41MDk4MDM5NTA4IDAgMAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIAlwaysBounceVertical">YES</bool>
|
||||
<int key="IBUISeparatorStyle">1</int>
|
||||
<int key="IBUISectionIndexMinimumDisplayRowCount">10</int>
|
||||
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
|
||||
<float key="IBUIRowHeight">44</float>
|
||||
<float key="IBUISectionHeaderHeight">22</float>
|
||||
<float key="IBUISectionFooterHeight">22</float>
|
||||
<reference key="IBUITableHeaderView" ref="947254156"/>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 20}, {320, 411}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC41MjcxNzM5MTMgMCAwAA</bytes>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
|
||||
<object class="IBUIScreenMetrics" key="IBUISimulatedDestinationMetrics">
|
||||
<string key="IBUISimulatedSizeMetricsClass">IBUIScreenMetrics</string>
|
||||
<object class="NSMutableDictionary" key="IBUINormalizedOrientationToSizeMap">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="1"/>
|
||||
<integer value="3"/>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>{320, 480}</string>
|
||||
<string>{480, 320}</string>
|
||||
</object>
|
||||
</object>
|
||||
<string key="IBUITargetRuntime">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIDisplayName">Retina 3.5 Full Screen</string>
|
||||
<int key="IBUIType">0</int>
|
||||
</object>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUISearchDisplayController" id="406061483">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchDisplayController</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="406061483"/>
|
||||
</object>
|
||||
<int key="connectionID">15</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">mainTableView</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="600119369"/>
|
||||
</object>
|
||||
<int key="connectionID">5</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="600119369"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">9</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="600119369"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">10</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="947254156"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">20</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchContentsController</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">16</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchResultsDataSource</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">17</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchResultsDelegate</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">18</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">19</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchBar</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="947254156"/>
|
||||
</object>
|
||||
<int key="connectionID">14</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<object class="NSArray" key="object" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="600119369"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">13</int>
|
||||
<reference key="object" ref="406061483"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="600119369"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="947254156"/>
|
||||
</object>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">12</int>
|
||||
<reference key="object" ref="947254156"/>
|
||||
<reference key="parent" ref="600119369"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>12.IBPluginDependency</string>
|
||||
<string>13.IBPluginDependency</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>MessierZoekFormulierViewController</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>UIResponder</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">27</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">2083</string>
|
||||
</data>
|
||||
</archive>
|
||||
39
Classes/MyCLController.h
Executable file
39
Classes/MyCLController.h
Executable file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// MyCLController.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 21-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@protocol MyCLControllerDelegate
|
||||
@required
|
||||
- (void)locationUpdate:(CLLocation *)location;
|
||||
- (void)headingUpdate:(CLHeading *)heading;
|
||||
|
||||
- (void)locationError:(NSError *)error;
|
||||
@end
|
||||
|
||||
|
||||
@interface MyCLController : NSObject <CLLocationManagerDelegate> {
|
||||
CLLocationManager *locationManager;
|
||||
id <MyCLControllerDelegate> __unsafe_unretained delegate;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) CLLocationManager *locationManager;
|
||||
@property (unsafe_unretained) id delegate;
|
||||
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager
|
||||
didUpdateToLocation:(CLLocation *)newLocation
|
||||
fromLocation:(CLLocation *)oldLocation;
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager
|
||||
didFailWithError:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
66
Classes/MyCLController.m
Executable file
66
Classes/MyCLController.m
Executable file
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// MyCLController.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 21-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MyCLController.h"
|
||||
|
||||
@implementation MyCLController
|
||||
|
||||
@synthesize locationManager;
|
||||
@synthesize delegate;
|
||||
|
||||
- (id) init {
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
self.locationManager = [[CLLocationManager alloc] init] ;
|
||||
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
|
||||
self.locationManager.delegate = self; // send loc updates to myself
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager
|
||||
didUpdateToLocation:(CLLocation *)newLocation
|
||||
fromLocation:(CLLocation *)oldLocation
|
||||
{
|
||||
|
||||
[self.delegate locationUpdate:newLocation];
|
||||
}
|
||||
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
|
||||
{
|
||||
|
||||
[self.delegate headingUpdate:newHeading];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager {
|
||||
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(locationManagerShouldDisplayHeadingCalibration:)]) {
|
||||
|
||||
return [self.delegate locationManagerShouldDisplayHeadingCalibration:manager];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)locationManager:(CLLocationManager *)manager
|
||||
didFailWithError:(NSError *)error
|
||||
{
|
||||
[self.delegate locationError:error];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
36
Classes/MySingleton.h
Executable file
36
Classes/MySingleton.h
Executable file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// MySingleton.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-02-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface MySingleton : NSObject {
|
||||
NSString *objectkeuze;
|
||||
double rechteklimming;
|
||||
double declinatie;
|
||||
NSString *objectName;
|
||||
NSString *objectConst;
|
||||
NSString *objectMagnitude;
|
||||
NSString *objectSize;
|
||||
NSString *objectNotes;
|
||||
NSString *objectType;
|
||||
}
|
||||
@property (nonatomic, retain) NSString* objectName;
|
||||
@property (nonatomic, retain) NSString* objectkeuze;
|
||||
@property (nonatomic, retain) NSString* objectMagnitude;
|
||||
@property (nonatomic, retain) NSString* objectSize;
|
||||
@property (nonatomic, retain) NSString* objectNotes;
|
||||
@property (nonatomic, retain) NSString* objectType;
|
||||
@property (nonatomic, retain) NSString* objectConst;
|
||||
@property(nonatomic, assign) double rechteklimming;
|
||||
@property(nonatomic, assign) double declinatie;
|
||||
|
||||
+(MySingleton*)sharedMySingleton;
|
||||
|
||||
|
||||
@end
|
||||
63
Classes/MySingleton.m
Executable file
63
Classes/MySingleton.m
Executable file
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// MySingleton.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-02-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MySingleton.h"
|
||||
|
||||
|
||||
@implementation MySingleton
|
||||
|
||||
|
||||
@synthesize objectkeuze;
|
||||
@synthesize rechteklimming;
|
||||
@synthesize declinatie;
|
||||
@synthesize objectMagnitude;
|
||||
@synthesize objectSize;
|
||||
@synthesize objectNotes;
|
||||
@synthesize objectType;
|
||||
@synthesize objectName;
|
||||
@synthesize objectConst;
|
||||
|
||||
|
||||
static MySingleton* _sharedMySingleton = nil;
|
||||
|
||||
+(MySingleton*)sharedMySingleton
|
||||
{
|
||||
static MySingleton *sharedSomeClassInstance = nil;
|
||||
static dispatch_once_t predicate;
|
||||
dispatch_once(&predicate, ^{
|
||||
sharedSomeClassInstance = [[self alloc] init];
|
||||
});
|
||||
return sharedSomeClassInstance;
|
||||
}
|
||||
|
||||
+(id)alloc
|
||||
{
|
||||
@synchronized([MySingleton class])
|
||||
{
|
||||
NSAssert(_sharedMySingleton == nil, @"Attempted to allocate a second instance of a singleton.");
|
||||
_sharedMySingleton = [super alloc];
|
||||
return _sharedMySingleton;
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
-(id)init {
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
// initialize stuff here
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
37
Classes/NGCZoekFormulierViewController.h
Executable file
37
Classes/NGCZoekFormulierViewController.h
Executable file
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// ZoekFormulierViewController.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-02-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "catalogus.h"
|
||||
|
||||
|
||||
@interface NGCZoekFormulierViewController : UIViewController < UITableViewDataSource, UITableViewDelegate> {
|
||||
UITableView *mainTableView;
|
||||
NSMutableArray *contentsList;
|
||||
NSMutableArray *searchResults;
|
||||
|
||||
NSString *savedSearchTerm;
|
||||
NSString *databaseName;
|
||||
NSString *databasePath;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UITableView *mainTableView;
|
||||
@property (nonatomic, retain) NSMutableArray *contentsList;
|
||||
@property (nonatomic, retain) NSMutableArray *searchResults;
|
||||
@property (nonatomic, retain) NSString *savedSearchTerm;
|
||||
@property (nonatomic, retain) NSString *databaseName, *databasePath;
|
||||
|
||||
|
||||
- (void)handleSearchForTerm:(NSString *)searchTerm;
|
||||
- (void)checkAndCreateDatabase;
|
||||
- (void)readObjectsFromDatabase;
|
||||
|
||||
@end
|
||||
418
Classes/NGCZoekFormulierViewController.m
Executable file
418
Classes/NGCZoekFormulierViewController.m
Executable file
@@ -0,0 +1,418 @@
|
||||
//
|
||||
// ZoekFormulierViewController.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-02-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NGCZoekFormulierViewController.h"
|
||||
#import "MySingleton.h"
|
||||
#import <sqlite3.h>
|
||||
#import "catalogus.h"
|
||||
|
||||
|
||||
@implementation NGCZoekFormulierViewController
|
||||
|
||||
|
||||
@synthesize mainTableView;
|
||||
@synthesize contentsList;
|
||||
@synthesize searchResults;
|
||||
@synthesize savedSearchTerm;
|
||||
@synthesize databaseName, databasePath;
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc. that aren't in use.
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
|
||||
[super viewDidLoad];
|
||||
|
||||
[self.mainTableView
|
||||
setBackgroundColor:[UIColor blackColor]];
|
||||
|
||||
UIColor *NightColor=[UIColor colorWithRed:70 green:0 blue:0 alpha:0.8];
|
||||
[self.mainTableView setSeparatorColor:NightColor];
|
||||
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
|
||||
databaseName = @"catalogus.sqlite";
|
||||
// Get the path to the documents directory and append the databaseName
|
||||
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
|
||||
|
||||
NSString *documentsDir = [documentPaths objectAtIndex:0];
|
||||
databasePath = [documentsDir stringByAppendingPathComponent: databaseName];
|
||||
|
||||
|
||||
|
||||
|
||||
[self checkAndCreateDatabase];
|
||||
[self readObjectsFromDatabase];
|
||||
|
||||
|
||||
|
||||
// Deze vervangen voor de databaseversie
|
||||
|
||||
|
||||
|
||||
|
||||
[self setContentsList:contentsList];
|
||||
|
||||
|
||||
|
||||
// Restore search term
|
||||
if ([self savedSearchTerm])
|
||||
{
|
||||
[[[self searchDisplayController] searchBar] setText:[self savedSearchTerm]];
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
|
||||
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
[[self mainTableView] reloadData];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)handleSearchForTerm:(NSString *)searchTerm
|
||||
{
|
||||
[self setSavedSearchTerm:searchTerm];
|
||||
|
||||
if ([self searchResults] == nil)
|
||||
{
|
||||
NSMutableArray *array = [[NSMutableArray alloc] init];
|
||||
[self setSearchResults:array];
|
||||
array = nil;
|
||||
}
|
||||
|
||||
[[self searchResults] removeAllObjects];
|
||||
|
||||
if ([[self savedSearchTerm] length] != 0)
|
||||
{
|
||||
|
||||
|
||||
|
||||
for (catalogus *zoekcatalogus in [self contentsList]) {
|
||||
|
||||
if ([zoekcatalogus.objectID rangeOfString:searchTerm options:NSCaseInsensitiveSearch].location != NSNotFound)
|
||||
{
|
||||
[[self searchResults] addObject:zoekcatalogus.objectID];
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
||||
{
|
||||
NSInteger rows;
|
||||
|
||||
if (tableView == [[self searchDisplayController] searchResultsTableView])
|
||||
rows = [[self searchResults] count];
|
||||
else
|
||||
rows = [[self contentsList] count];
|
||||
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void) tableView:(UITableView *) tableView
|
||||
didSelectRowAtIndexPath: (NSIndexPath *) indexPath {
|
||||
|
||||
|
||||
|
||||
UITableViewCell *cell;
|
||||
cell = [tableView cellForRowAtIndexPath:indexPath];
|
||||
|
||||
// ? volgens mij hier search
|
||||
// in contentslist zit een object
|
||||
// in searchlist alleen een tekststring
|
||||
|
||||
|
||||
|
||||
catalogus *mijnCatalogus = (catalogus *)[self.contentsList objectAtIndex: indexPath.row];
|
||||
|
||||
UIView *bgColorView = [[UIView alloc] init];
|
||||
|
||||
UIColor *NightColor=[UIColor colorWithRed:70 green:0 blue:0 alpha:0.8];
|
||||
|
||||
[bgColorView setBackgroundColor:NightColor];
|
||||
[cell setSelectedBackgroundView:bgColorView];
|
||||
|
||||
|
||||
|
||||
// Kommas naar punten
|
||||
|
||||
NSString *RAString = [mijnCatalogus.objectRA stringByReplacingOccurrencesOfString:@"," withString:@"."];
|
||||
NSString *DECString = [mijnCatalogus.objectDec stringByReplacingOccurrencesOfString:@"," withString:@"."];
|
||||
|
||||
|
||||
float rechteklimming = [RAString floatValue];
|
||||
float declinatie = [DECString floatValue];
|
||||
|
||||
[MySingleton sharedMySingleton].objectkeuze = mijnCatalogus.objectID;
|
||||
[MySingleton sharedMySingleton].declinatie=declinatie;
|
||||
[MySingleton sharedMySingleton].rechteklimming=rechteklimming;
|
||||
[MySingleton sharedMySingleton].objectMagnitude=mijnCatalogus.objectMagnitude;
|
||||
[MySingleton sharedMySingleton].objectType=mijnCatalogus.objectType;
|
||||
[MySingleton sharedMySingleton].objectSize=mijnCatalogus.objectSize;
|
||||
[MySingleton sharedMySingleton].objectNotes=mijnCatalogus.objectNotes;
|
||||
[MySingleton sharedMySingleton].objectName=mijnCatalogus.objectName;
|
||||
[MySingleton sharedMySingleton].objectConst=mijnCatalogus.objectConstellation;
|
||||
|
||||
if (tableView == [[self searchDisplayController] searchResultsTableView]) {
|
||||
for (catalogus *zoekcatalogus in [self contentsList]) {
|
||||
|
||||
if ([zoekcatalogus.objectID rangeOfString:cell.textLabel.text options:NSCaseInsensitiveSearch].location != NSNotFound)
|
||||
{
|
||||
NSString *RAString = [zoekcatalogus.objectRA stringByReplacingOccurrencesOfString:@"," withString:@"."];
|
||||
NSString *DECString = [zoekcatalogus.objectDec stringByReplacingOccurrencesOfString:@"," withString:@"."];
|
||||
double rechteklimming = [RAString doubleValue];
|
||||
double declinatie = [DECString doubleValue];
|
||||
[MySingleton sharedMySingleton].objectkeuze = zoekcatalogus.objectID;
|
||||
[MySingleton sharedMySingleton].rechteklimming=rechteklimming;
|
||||
[MySingleton sharedMySingleton].declinatie=declinatie;
|
||||
[MySingleton sharedMySingleton].objectMagnitude=zoekcatalogus.objectMagnitude;
|
||||
[MySingleton sharedMySingleton].objectType=zoekcatalogus.objectType;
|
||||
[MySingleton sharedMySingleton].objectSize=zoekcatalogus.objectSize;
|
||||
[MySingleton sharedMySingleton].objectNotes=zoekcatalogus.objectNotes;
|
||||
[MySingleton sharedMySingleton].objectConst=zoekcatalogus.objectConstellation;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
NSInteger row = [indexPath row];
|
||||
NSString *contentForThisRow=NULL ;
|
||||
|
||||
|
||||
if (tableView == [[self searchDisplayController] searchResultsTableView]) {
|
||||
contentForThisRow = [[self searchResults] objectAtIndex:row];
|
||||
|
||||
}
|
||||
else {
|
||||
catalogus *mijnCatalogus = (catalogus *)[self.contentsList objectAtIndex: row];
|
||||
contentForThisRow = mijnCatalogus.objectID;
|
||||
}
|
||||
|
||||
|
||||
static NSString *CellIdentifier = @"CellIdentifier";
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
|
||||
if (cell == nil)
|
||||
{
|
||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
|
||||
}
|
||||
|
||||
|
||||
|
||||
UIFont *myFont = [ UIFont fontWithName: @"System" size: 16.0 ];
|
||||
cell.textLabel.font = myFont;
|
||||
// Set up the cell...
|
||||
|
||||
UIColor *NightColor=[UIColor colorWithRed:70 green:0 blue:0 alpha:0.8];
|
||||
|
||||
cell.textLabel.textColor=NightColor;
|
||||
|
||||
[[cell textLabel] setText:contentForThisRow];
|
||||
|
||||
|
||||
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller
|
||||
{
|
||||
[self setSavedSearchTerm:nil];
|
||||
|
||||
[[self mainTableView] reloadData];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller
|
||||
shouldReloadTableForSearchString:(NSString *)searchString
|
||||
{
|
||||
|
||||
|
||||
// Tint
|
||||
CGFloat nRed=84.0/255.0;
|
||||
CGFloat nBlue=8/255.0;
|
||||
CGFloat nGreen=4.0/255.0;
|
||||
UIColor *nightColor=[[UIColor alloc]initWithRed:nRed green:nBlue blue:nGreen alpha:1];
|
||||
[controller.searchResultsTableView setBackgroundColor:nightColor];
|
||||
controller.searchResultsTableView.bounces=FALSE;
|
||||
|
||||
[self handleSearchForTerm:searchString];
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)viewDidUnload
|
||||
{
|
||||
[super viewDidUnload];
|
||||
|
||||
// Save the state of the search UI so that it can be restored if the view is re-created.
|
||||
[self setSavedSearchTerm:[[[self searchDisplayController] searchBar] text]];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[self setSearchResults:nil];
|
||||
}
|
||||
|
||||
- (void) checkAndCreateDatabase{
|
||||
|
||||
// Check if the SQL database has already been saved to the users phone, if not then copy it over
|
||||
BOOL success;
|
||||
|
||||
// Create a FileManager object, we will use this to check the status
|
||||
// of the database and to copy it over if required
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
|
||||
// Check if the database has already been created in the users filesystem
|
||||
success = [fileManager fileExistsAtPath:databasePath];
|
||||
|
||||
// If the database already exists then return without doing anything
|
||||
if(success) return;
|
||||
|
||||
// If not then proceed to copy the database from the application to the users filesystem
|
||||
|
||||
// Get the path to the database in the application package
|
||||
NSString *databasePathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:databaseName];
|
||||
|
||||
// Copy the database from the package to the users filesystem
|
||||
[fileManager copyItemAtPath:databasePathFromApp toPath:databasePath error:nil];
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void) readObjectsFromDatabase{
|
||||
|
||||
|
||||
// Setup the database object
|
||||
sqlite3 *database;
|
||||
|
||||
contentsList = [[NSMutableArray alloc] init];
|
||||
|
||||
// Open the database from the users filessytem
|
||||
if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {
|
||||
|
||||
// Setup the SQL Statement and compile it for faster access
|
||||
const char *sqlStatement = "select * from ngc";
|
||||
|
||||
sqlite3_stmt *compiledStatement;
|
||||
|
||||
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
|
||||
|
||||
// Loop through the results and add them to the feeds array
|
||||
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
|
||||
|
||||
|
||||
|
||||
NSString *bOobjectID = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)];
|
||||
NSString *bobjectName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
|
||||
NSString *bobjectType = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];
|
||||
NSString *bobjectRA = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];
|
||||
NSString *bobjectDec = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 4)];
|
||||
NSString *bobjectMagnitude = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 5)];
|
||||
NSString *bobjectSize = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 6)];
|
||||
NSString *bobjectConstellation = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 7)];
|
||||
NSString *bobjectNotes = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 8)];
|
||||
|
||||
|
||||
|
||||
[self.contentsList addObject:[catalogus objectWithID:bOobjectID objectName:bobjectName objectType:bobjectType objectRA:bobjectRA objectDec:bobjectDec objectMagnitude:bobjectMagnitude objectSize:bobjectSize objectConstellation:bobjectConstellation objectNotes:bobjectNotes]];
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Release the compiled statement from memory
|
||||
sqlite3_finalize(compiledStatement);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"objectID" ascending:YES];
|
||||
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
|
||||
NSArray *sortedArray = [contentsList sortedArrayUsingDescriptors:sortDescriptors];
|
||||
|
||||
self.contentsList = [sortedArray mutableCopy];
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
sqlite3_close(database);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
323
Classes/NGCZoekFormulierViewController.xib
Executable file
323
Classes/NGCZoekFormulierViewController.xib
Executable file
@@ -0,0 +1,323 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1552</int>
|
||||
<string key="IBDocument.SystemVersion">12E55</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.39</string>
|
||||
<string key="IBDocument.HIToolboxVersion">626.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">2083</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUISearchBar</string>
|
||||
<string>IBUISearchDisplayController</string>
|
||||
<string>IBUITableView</string>
|
||||
<string>IBUIView</string>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUITableView" id="600119369">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<object class="NSMutableArray" key="NSSubviews">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBUISearchBar" id="947254156">
|
||||
<reference key="NSNextResponder" ref="600119369"/>
|
||||
<int key="NSvFlags">290</int>
|
||||
<string key="NSFrameSize">{320, 44}</string>
|
||||
<reference key="NSSuperview" ref="600119369"/>
|
||||
<reference key="NSWindow"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
</object>
|
||||
<int key="IBUIContentMode">3</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSColor" key="IBTintColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC41MjcxNzM5MTMgMCAwAA</bytes>
|
||||
</object>
|
||||
<object class="IBUITextInputTraits" key="IBTextInputTraits">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrameSize">{320, 411}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="947254156"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC42NzUyNzE3MzkxIDAgMAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIAlwaysBounceVertical">YES</bool>
|
||||
<int key="IBUISeparatorStyle">1</int>
|
||||
<int key="IBUISectionIndexMinimumDisplayRowCount">10</int>
|
||||
<bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
|
||||
<float key="IBUIRowHeight">44</float>
|
||||
<float key="IBUISectionHeaderHeight">22</float>
|
||||
<float key="IBUISectionFooterHeight">22</float>
|
||||
<reference key="IBUITableHeaderView" ref="947254156"/>
|
||||
</object>
|
||||
</object>
|
||||
<string key="NSFrame">{{0, 20}, {320, 411}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="600119369"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC41MjcxNzM5MTMgMCAwAA</bytes>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUISearchDisplayController" id="406061483">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<object class="NSMutableArray" key="connectionRecords">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">mainTableView</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="600119369"/>
|
||||
</object>
|
||||
<int key="connectionID">5</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchDisplayController</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="406061483"/>
|
||||
</object>
|
||||
<int key="connectionID">15</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">dataSource</string>
|
||||
<reference key="source" ref="600119369"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">9</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="600119369"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">10</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="947254156"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">20</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchBar</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="947254156"/>
|
||||
</object>
|
||||
<int key="connectionID">14</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchContentsController</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">16</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchResultsDataSource</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">17</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">searchResultsDelegate</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">18</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">delegate</string>
|
||||
<reference key="source" ref="406061483"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
</object>
|
||||
<int key="connectionID">19</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<object class="NSArray" key="object" id="0">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
</object>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="600119369"/>
|
||||
</object>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="600119369"/>
|
||||
<object class="NSMutableArray" key="children">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="947254156"/>
|
||||
</object>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">13</int>
|
||||
<reference key="object" ref="406061483"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">12</int>
|
||||
<reference key="object" ref="947254156"/>
|
||||
<reference key="parent" ref="600119369"/>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="flattenedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>-1.CustomClassName</string>
|
||||
<string>-1.IBPluginDependency</string>
|
||||
<string>-2.CustomClassName</string>
|
||||
<string>-2.IBPluginDependency</string>
|
||||
<string>1.IBPluginDependency</string>
|
||||
<string>12.IBPluginDependency</string>
|
||||
<string>13.IBPluginDependency</string>
|
||||
<string>4.IBPluginDependency</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NGCZoekFormulierViewController</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>UIResponder</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="unlocalizedProperties">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="activeLocalization"/>
|
||||
<object class="NSMutableDictionary" key="localizations">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference key="dict.sortedKeys" ref="0"/>
|
||||
<reference key="dict.values" ref="0"/>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">30</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NGCZoekFormulierViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">mainTableView</string>
|
||||
<string key="NS.object.0">UITableView</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">mainTableView</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">mainTableView</string>
|
||||
<string key="candidateClassName">UITableView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/NGCZoekFormulierViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="3000" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">2083</string>
|
||||
</data>
|
||||
</archive>
|
||||
23
Classes/OrientationAppDelegate.h
Executable file
23
Classes/OrientationAppDelegate.h
Executable file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@class OrientationViewController;
|
||||
|
||||
@interface OrientationAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
|
||||
UIWindow *window;
|
||||
IBOutlet UITabBarController *tabBarController;
|
||||
|
||||
OrientationViewController *viewController;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UIWindow *window;
|
||||
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
|
||||
@property (nonatomic, retain) IBOutlet OrientationViewController *viewController;
|
||||
|
||||
@end
|
||||
|
||||
32
Classes/OrientationAppDelegate.m
Executable file
32
Classes/OrientationAppDelegate.m
Executable file
@@ -0,0 +1,32 @@
|
||||
#import "OrientationAppDelegate.h"
|
||||
#import "OrientationViewController.h"
|
||||
#import "MessierZoekformulierViewController.h"
|
||||
#import "NGCZoekformulierViewController.h"
|
||||
|
||||
|
||||
|
||||
@implementation OrientationAppDelegate
|
||||
|
||||
@synthesize window;
|
||||
@synthesize viewController;
|
||||
@synthesize tabBarController;
|
||||
|
||||
|
||||
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
||||
|
||||
// Override point for customization after app launch
|
||||
[window addSubview:viewController.view];
|
||||
[window addSubview:tabBarController.view];
|
||||
[window makeKeyAndVisible];
|
||||
self.window.rootViewController = self.tabBarController;
|
||||
|
||||
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:YES ];
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
67
Classes/OrientationViewController.h
Executable file
67
Classes/OrientationViewController.h
Executable file
@@ -0,0 +1,67 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "MyCLController.h"
|
||||
#import "MySingleton.h"
|
||||
#import <CoreMotion/CoreMotion.h>
|
||||
|
||||
|
||||
@interface OrientationViewController : UIViewController
|
||||
<UIAccelerometerDelegate, MyCLControllerDelegate, UITabBarDelegate> {
|
||||
MyCLController *locationController;
|
||||
CMMotionManager *motionManager;
|
||||
NSOperationQueue *opQ;
|
||||
|
||||
IBOutlet UITabBar *tabBar;
|
||||
IBOutlet UILabel *alt;
|
||||
IBOutlet UILabel *az;
|
||||
IBOutlet UILabel *objalt;
|
||||
IBOutlet UILabel *objaz;
|
||||
IBOutlet UILabel *latLabel;
|
||||
IBOutlet UILabel *longLabel;
|
||||
IBOutlet UILabel *timeLabel;
|
||||
IBOutlet UILabel *radecinfoLabel;
|
||||
IBOutlet UILabel *constLabel;
|
||||
|
||||
IBOutlet UILabel *objectIDlabel;
|
||||
IBOutlet UILabel *objconstlabel;
|
||||
IBOutlet UILabel *horizvertlabel;
|
||||
IBOutlet UILabel *objectlabel;
|
||||
IBOutlet UILabel *objtypeLabel;
|
||||
|
||||
IBOutlet UILabel *objsizeLabel;
|
||||
IBOutlet UILabel *objmagLabel;
|
||||
IBOutlet UITextView *objnotes;
|
||||
|
||||
IBOutlet UIImageView *AZdirectionArrow;
|
||||
IBOutlet UIImageView *ALTdirectionArrow;
|
||||
CLLocation *locatie;
|
||||
NSTimer *backgroundTimer;
|
||||
}
|
||||
|
||||
|
||||
@property (nonatomic, retain) UILabel *alt;
|
||||
@property (nonatomic, retain) UILabel *az;
|
||||
@property (nonatomic, retain) UILabel *objalt;
|
||||
@property (nonatomic, retain) UILabel *objaz;
|
||||
@property (nonatomic, retain) UILabel *latLabel;
|
||||
@property (nonatomic, retain) UILabel *longLabel;
|
||||
@property (nonatomic, retain) UILabel *timeLabel;
|
||||
@property (nonatomic, retain) UILabel *radecinfoLabel;
|
||||
@property (nonatomic, retain) UILabel *objsizeLabel;
|
||||
@property (nonatomic, retain) UILabel *objmagLabel;
|
||||
@property (nonatomic, retain) UILabel *objtypeLabel;
|
||||
@property (nonatomic, retain) UILabel *objectIDlabel;
|
||||
@property (nonatomic, retain) UILabel *objconstlabel;
|
||||
@property (nonatomic, retain) UITextView *objnotes;
|
||||
@property (nonatomic, retain) UILabel *objectlabel;
|
||||
@property (nonatomic, retain) UILabel *horizvertlabel;
|
||||
|
||||
@property (retain, nonatomic) UIImageView *ALTdirectionArrow;
|
||||
@property (retain, nonatomic) UIImageView *AZdirectionArrow;
|
||||
@property (nonatomic,retain) CLLocation *locatie;
|
||||
|
||||
-(BOOL)isvertical;
|
||||
-(void)convertradectoaltaz;
|
||||
|
||||
|
||||
@end
|
||||
635
Classes/OrientationViewController.m
Executable file
635
Classes/OrientationViewController.m
Executable file
@@ -0,0 +1,635 @@
|
||||
|
||||
#import "OrientationViewController.h"
|
||||
#import "MessierZoekFormulierViewController.h"
|
||||
#import "NGCZoekFormulierViewController.h"
|
||||
#import <AudioToolbox/AudioToolbox.h>
|
||||
#include "Math.h"
|
||||
|
||||
@implementation OrientationViewController
|
||||
|
||||
|
||||
@synthesize alt;
|
||||
@synthesize az;
|
||||
@synthesize objalt;
|
||||
@synthesize objaz;
|
||||
@synthesize latLabel;
|
||||
@synthesize longLabel;
|
||||
@synthesize timeLabel;
|
||||
@synthesize radecinfoLabel;
|
||||
@synthesize objectIDlabel;
|
||||
@synthesize objconstlabel;
|
||||
@synthesize objectlabel;
|
||||
@synthesize objsizeLabel;
|
||||
@synthesize objmagLabel;
|
||||
@synthesize horizvertlabel;
|
||||
@synthesize objnotes;
|
||||
@synthesize objtypeLabel;
|
||||
@synthesize ALTdirectionArrow;
|
||||
@synthesize AZdirectionArrow;
|
||||
@synthesize locatie;
|
||||
|
||||
|
||||
double ALT, AZ;
|
||||
|
||||
NSString *strObjectinfo;
|
||||
|
||||
|
||||
- (id) init {
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
}
|
||||
return self;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark UIAccelerometerDelegate
|
||||
|
||||
- (void)accelerometer:(UIAccelerometer *)accelerometer
|
||||
didAccelerate:(UIAcceleration *)acceleration {
|
||||
|
||||
|
||||
double y,z;
|
||||
|
||||
y = (double)acceleration.y;
|
||||
z =(double) acceleration.z;
|
||||
y=y*-1;
|
||||
if (y>1) y=1;
|
||||
if (y<-1) y=-1;
|
||||
|
||||
|
||||
// projected on sphere
|
||||
y = acos(y) ;
|
||||
y = (y / 3.14151927 ) * 180;
|
||||
|
||||
// y=y-180;
|
||||
// als z negatief is dan is y dat ook.
|
||||
|
||||
|
||||
// if (z<0) y=y*-1;
|
||||
// NSLog (@"Z %.2f",z );
|
||||
|
||||
// round to 2 digits
|
||||
y= (round(y*100.0)/100.0);
|
||||
|
||||
|
||||
if (!isnan(y)) {
|
||||
alt.text=@"";
|
||||
}
|
||||
|
||||
|
||||
if (z<0) y=y*-1;
|
||||
|
||||
|
||||
if (![self isvertical]) {
|
||||
|
||||
y=y+90;
|
||||
|
||||
} else
|
||||
|
||||
|
||||
|
||||
|
||||
if (isnan(y)) {
|
||||
alt.text=@"";
|
||||
}
|
||||
alt.text = [NSString stringWithFormat:@"%.2f", y];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
double delta = ((ALT-y));
|
||||
|
||||
|
||||
|
||||
|
||||
if (abs(delta) <= 2 ) {
|
||||
ALTdirectionArrow.image = [UIImage imageNamed:@"bullseye.png"]; // target
|
||||
|
||||
|
||||
} else {
|
||||
if (delta > 5) ALTdirectionArrow.image =
|
||||
[UIImage imageNamed:@"up_arrow.png"];
|
||||
else
|
||||
if (delta < 0) ALTdirectionArrow.image =
|
||||
[UIImage imageNamed:@"down_arrow.png"];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
|
||||
/*
|
||||
// The designated initializer. Override to perform setup that is required before the view is loaded.
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
|
||||
// Custom initialization
|
||||
}
|
||||
return self;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Implement loadView to create a view hierarchy programmatically, without using a nib.
|
||||
- (void)loadView {
|
||||
}
|
||||
*/
|
||||
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
|
||||
[super viewDidLoad];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
locationController = [[MyCLController alloc] init];
|
||||
locationController.delegate = self;
|
||||
tabBar.delegate = self;
|
||||
motionManager = [[CMMotionManager alloc] init];
|
||||
|
||||
[locationController.locationManager startUpdatingLocation];
|
||||
[locationController.locationManager startUpdatingHeading];
|
||||
|
||||
|
||||
|
||||
// Kost wat meer batterij, maar precisie boven alles.
|
||||
locationController.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
|
||||
locationController.locationManager.headingFilter = kCLHeadingFilterNone;
|
||||
|
||||
UIAccelerometer *accelerometer = [UIAccelerometer sharedAccelerometer];
|
||||
accelerometer.delegate = self;
|
||||
|
||||
// Terugzetten naar 0.5 voor productie!
|
||||
|
||||
accelerometer.updateInterval = 0.1;
|
||||
|
||||
// timer voor update / elke 10 seconden
|
||||
backgroundTimer = [NSTimer scheduledTimerWithTimeInterval: 10.0 target: self selector: @selector(convertradectoaltaz) userInfo: nil repeats: YES];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
|
||||
strObjectinfo=[MySingleton sharedMySingleton].objectName;
|
||||
if (strObjectinfo==NULL) { strObjectinfo=@"Please choose..";
|
||||
|
||||
objalt.text=@"";
|
||||
objaz.text=@"";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
objectIDlabel.text=[MySingleton sharedMySingleton].objectkeuze;
|
||||
objectlabel.text=strObjectinfo;
|
||||
|
||||
|
||||
|
||||
[self convertradectoaltaz];
|
||||
|
||||
// Laat zien op scherm
|
||||
double ra,dec;
|
||||
|
||||
ra=[MySingleton sharedMySingleton].rechteklimming;
|
||||
dec=[MySingleton sharedMySingleton].declinatie;
|
||||
|
||||
NSString *radecstr = [NSString stringWithFormat:@"RA %.2f DEC %.2f", ra, dec];
|
||||
radecinfoLabel.text= radecstr;
|
||||
objsizeLabel.text=[MySingleton sharedMySingleton].objectSize;
|
||||
objmagLabel.text=[MySingleton sharedMySingleton].objectMagnitude;
|
||||
objnotes.text=[MySingleton sharedMySingleton].objectNotes;
|
||||
objtypeLabel.text=[MySingleton sharedMySingleton].objectType;
|
||||
objconstlabel.text=[MySingleton sharedMySingleton].objectConst;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc that aren't in use.
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
// Release any retained subviews of the main view.
|
||||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (void) convertradectoaltaz {
|
||||
|
||||
NSString *strUren;
|
||||
NSString *strMinuten;
|
||||
NSString *strJaar;
|
||||
NSString *strMaand;
|
||||
NSString *strDag;
|
||||
|
||||
|
||||
|
||||
double latit, longit, lst, rechteklimming, declinatie, uurhoek, dag, maand, uren, minuten, maanddagen, dagdagen ;
|
||||
double dagenj2000, dectijd, tijdut;
|
||||
double HARad, DECRad, ALTRad,LatRad, sinALT, cosAZ,AZ11,AZ12,sinAZ,AZ21,AZ22;
|
||||
// initialiseren
|
||||
dagdagen=0;
|
||||
maanddagen=0;
|
||||
|
||||
// intitialiseren waardes
|
||||
|
||||
latit=self.locatie.coordinate.latitude;
|
||||
longit=self.locatie.coordinate.longitude;
|
||||
|
||||
// singleton data gebruiken.
|
||||
|
||||
rechteklimming=[MySingleton sharedMySingleton].rechteklimming;
|
||||
declinatie=[MySingleton sharedMySingleton].declinatie;
|
||||
|
||||
/*
|
||||
// DEBUG UITZETTEN!
|
||||
// Test voor M13
|
||||
rechteklimming=16.695;
|
||||
declinatie=36.46;
|
||||
latit=52.5;
|
||||
longit=-1.91;
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// We werken in UTC
|
||||
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"GMT"];
|
||||
|
||||
|
||||
[formatter setTimeZone:timeZone];
|
||||
|
||||
|
||||
// Dag grabben
|
||||
[formatter setDateFormat:@"dd"];
|
||||
strDag= [formatter stringFromDate:self.locatie.timestamp];
|
||||
// NSLog(@"Dag:% @" ,strDag);
|
||||
|
||||
// Maand grabben
|
||||
[formatter setDateFormat:@"MM"];
|
||||
strMaand= [formatter stringFromDate:self.locatie.timestamp];
|
||||
// NSLog(@"Maand: %@" ,strMaand);
|
||||
|
||||
|
||||
// Uren grabben
|
||||
[formatter setDateFormat:@"HH"];
|
||||
strUren= [formatter stringFromDate:self.locatie.timestamp];
|
||||
// NSLog(@"Uur: %@" ,strUren);
|
||||
|
||||
|
||||
// Minuten grabben
|
||||
[formatter setDateFormat:@"mm"];
|
||||
strMinuten= [formatter stringFromDate:self.locatie.timestamp];
|
||||
|
||||
|
||||
// Jaar grabben
|
||||
[formatter setDateFormat:@"yyyy"];
|
||||
strJaar= [formatter stringFromDate:self.locatie.timestamp];
|
||||
|
||||
/*
|
||||
// Debug UITZETTEN!!
|
||||
strDag=@"10";
|
||||
strMaand=@"08";
|
||||
strUren=@"23";
|
||||
strMinuten=@"10";
|
||||
strJaar=@"1998";
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Converteer string naar float
|
||||
|
||||
|
||||
dag = [strDag doubleValue];
|
||||
maand = [strMaand doubleValue];
|
||||
uren = [strUren doubleValue];
|
||||
minuten = [strMinuten doubleValue];
|
||||
|
||||
// Aantal dagen sinds epoch 2000 berekenen
|
||||
|
||||
// Maak van uren+minuten een decimaal
|
||||
dectijd =uren + (minuten/60);
|
||||
dectijd = dectijd/24;
|
||||
|
||||
// NSLog(@"Dectijd %.2f", dectijd);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// NSLog(@"Latit %.2f, Longit %.2f, RA %.2f,DEC %.2f", latit,longit,rechteklimming,declinatie);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// in een array plaatsen!
|
||||
// maanddagen= 31; // Aantal dagen sinds begin van het jaar Augustus in een niet-schrikkeljaar
|
||||
|
||||
int intMaand = (int) maand;
|
||||
|
||||
|
||||
switch(intMaand)
|
||||
{
|
||||
case 1 :
|
||||
maanddagen =0;
|
||||
break;
|
||||
case 2 :
|
||||
maanddagen =31;
|
||||
break;
|
||||
case 3 :
|
||||
maanddagen =59;
|
||||
break;
|
||||
case 4 :
|
||||
maanddagen =90;
|
||||
break;
|
||||
case 5 :
|
||||
maanddagen =120;
|
||||
break;
|
||||
case 6 :
|
||||
maanddagen =151;
|
||||
break;
|
||||
case 7 :
|
||||
maanddagen =181;
|
||||
break;
|
||||
case 8 :
|
||||
maanddagen =212;
|
||||
break;
|
||||
case 9 :
|
||||
maanddagen =243;
|
||||
break;
|
||||
case 10 :
|
||||
maanddagen =273;
|
||||
break;
|
||||
case 11 :
|
||||
maanddagen =304;
|
||||
break;
|
||||
case 12 :
|
||||
maanddagen =334;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ([strJaar isEqual:@"2013"]) dagdagen=4747.5;
|
||||
if ([strJaar isEqual:@"2014"]) dagdagen=5112.5;
|
||||
if ([strJaar isEqual:@"2015"]) dagdagen=5477.5;
|
||||
if ([strJaar isEqual:@"2016"]) {
|
||||
// schrikkeljaar!
|
||||
|
||||
dagdagen=5842.5;
|
||||
if ([strMaand isEqual:@"01"]) maanddagen=0;
|
||||
if ([strMaand isEqual:@"02"]) maanddagen=31;
|
||||
if([strMaand isEqual:@"03"]) maanddagen=60;
|
||||
if ([strMaand isEqual:@"04"]) maanddagen=91;
|
||||
if ([strMaand isEqual:@"05"]) maanddagen=121;
|
||||
if ([strMaand isEqual:@"06"]) maanddagen=152;
|
||||
if ([strMaand isEqual:@"07"]) maanddagen=182;
|
||||
if([strMaand isEqual:@"08"]) maanddagen=213;
|
||||
if([strMaand isEqual:@"09"]) maanddagen=244;
|
||||
if ([strMaand isEqual:@"10"]) maanddagen=274;
|
||||
if ([strMaand isEqual:@"11"]) maanddagen=305;
|
||||
if ([strMaand isEqual:@"12"]) maanddagen=335;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ([strJaar isEqual:@"2017"]) dagdagen=6208.5;
|
||||
if ([strJaar isEqual:@"2018"]) dagdagen=6573.5;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// optellen en aantal dagen bepalen sinds 01-01-2000 0:00
|
||||
|
||||
dagenj2000=dectijd+maanddagen+dag+dagdagen;
|
||||
|
||||
// NSLog(@"Dagen J2000 %.2f = dectijd %.2f + maanddagen %.2f + dag %.2f + dagdagen %.2f", dagenj2000, dectijd, maanddagen,dag,dagdagen);
|
||||
|
||||
|
||||
// Local Siderial Time
|
||||
|
||||
|
||||
// UT tijd berekenen
|
||||
tijdut =uren + (minuten/60);
|
||||
|
||||
lst = 100.46 + 0.985647 * dagenj2000 + longit + 15*tijdut ;
|
||||
|
||||
// modulusberekening. Cocoa doet alleen INT op modulus
|
||||
lst = lst - (floor(lst/ 360) *360);
|
||||
|
||||
|
||||
// Rechteklimming converteren van decimalen naar graden
|
||||
rechteklimming = rechteklimming * 15;
|
||||
|
||||
// Uurhoek berekenen. Als uurhoek <0 360 erbij optellen.
|
||||
|
||||
|
||||
uurhoek = lst - rechteklimming;
|
||||
if (uurhoek<0){
|
||||
uurhoek=uurhoek+360;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// NSLog(@"Uurhoek %.2f rechteklimming %.2f" ,uurhoek,rechteklimming);
|
||||
|
||||
|
||||
|
||||
// CONVERSIE RA/DEC --> ALTAZ
|
||||
|
||||
// Converteer graden naar radians;
|
||||
|
||||
HARad= (uurhoek*M_PI)/180;
|
||||
DECRad = (declinatie*M_PI)/180;
|
||||
LatRad = (latit*M_PI)/180;
|
||||
|
||||
sinALT = sin(DECRad) * sin(LatRad) + cos(DECRad)* cos(LatRad)* cos(HARad);
|
||||
ALTRad = asin(sinALT) ;
|
||||
ALT = ALTRad * 180/M_PI;
|
||||
cosAZ = (sin(DECRad)* cos(LatRad)- cos(DECRad)*cos(HARad)* sin(LatRad))/ cos(ALTRad) ;
|
||||
AZ11 = (acos(cosAZ)) * 180/M_PI ;
|
||||
AZ12 = 360 - AZ11 ;
|
||||
sinAZ = (-cos(DECRad)*sin(HARad))/cos(ALTRad);
|
||||
AZ21 = (asin(sinAZ)) * 180/M_PI ;
|
||||
if (AZ21 >=0 ) {AZ22 = 180 - AZ21 ;} else { AZ22 = 360 - AZ21 ; } ;
|
||||
if ((abs(AZ11-AZ21) <= 0.0001)||(abs(AZ11-AZ22) <= 0.0001)){
|
||||
AZ = AZ11 ;
|
||||
}else {AZ = AZ12 ;}
|
||||
|
||||
|
||||
|
||||
|
||||
// SCHERMOUTPUT
|
||||
|
||||
|
||||
strObjectinfo=[MySingleton sharedMySingleton].objectkeuze;
|
||||
objalt.text = [NSString stringWithFormat:@"%.2f", ALT];
|
||||
objaz.text = [NSString stringWithFormat:@"%.2f", AZ];
|
||||
|
||||
if (strObjectinfo==NULL) {
|
||||
objalt.text = @"";//[NSString stringWithFormat:@"%.2f", ALT];
|
||||
objaz.text =@"";// [NSString stringWithFormat:@"%.2f", AZ];
|
||||
}
|
||||
// Laat lat en Lon zien op scherm
|
||||
latLabel.text = [NSString stringWithFormat:@"Lat: %.2f", self.locatie.coordinate.latitude];
|
||||
longLabel.text = [NSString stringWithFormat:@"Lon: %.2f", self.locatie.coordinate.longitude];
|
||||
|
||||
// TijdLabel op scherm (terugconverteren naar GMT+1) --> Was een BUG!
|
||||
|
||||
timeZone = [NSTimeZone systemTimeZone];
|
||||
[formatter setTimeZone:timeZone];
|
||||
|
||||
[formatter setDateFormat:@"HH:mm"];
|
||||
|
||||
strUren= [formatter stringFromDate:self.locatie.timestamp];
|
||||
timeLabel.text= strUren;
|
||||
|
||||
|
||||
|
||||
if (ALT<0) { strObjectinfo=@"Object under horizon";
|
||||
|
||||
objalt.text=@"Under";
|
||||
objaz.text=@"Horizon";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)locationUpdate:(CLLocation *)location {
|
||||
self.locatie = location;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)headingUpdate:(CLHeading *)heading {
|
||||
|
||||
|
||||
|
||||
// If the accuracy is valid, process the event.
|
||||
|
||||
if (heading.headingAccuracy > 0)
|
||||
|
||||
{
|
||||
|
||||
az.text = [NSString stringWithFormat:@"%.2f", heading.trueHeading];
|
||||
|
||||
|
||||
|
||||
double delta = heading.trueHeading - AZ;
|
||||
if (abs(delta) <= 10) {
|
||||
AZdirectionArrow.image = [UIImage imageNamed:@"bullseye.png"]; // target
|
||||
} else {
|
||||
if (delta > 180) AZdirectionArrow.image =
|
||||
[UIImage imageNamed:@"right_arrow.png"];
|
||||
else if (delta > 0) AZdirectionArrow.image =
|
||||
[UIImage imageNamed:@"left_arrow.png"];
|
||||
else if (delta > -180) AZdirectionArrow.image =
|
||||
[UIImage imageNamed:@"right_arrow.png"];
|
||||
else AZdirectionArrow.image = [UIImage imageNamed:@"left_arrow.png"];
|
||||
}
|
||||
AZdirectionArrow.hidden = NO;
|
||||
} else {
|
||||
AZdirectionArrow.hidden = YES;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(BOOL) isvertical {
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
BOOL vertical = [defaults boolForKey:@"vertical"];
|
||||
if (vertical) {
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (void)locationError:(NSError *)error {
|
||||
latLabel.text = [error description];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (IBAction)infoButtonClick:(id)sender{
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"The Orientation window"
|
||||
message:@"Based on your selection, the Altitude and Azimuth are calculated for the object. Now you can point your telescope to the object. The numbers in the telescope position panel and the object panel should match. The arrows are here to help you. Hint: start with horizontal axis (like a compass) alignment, after that align vertically."
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles: nil];
|
||||
[alert show];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
36
Classes/catalogus.h
Normal file
36
Classes/catalogus.h
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
//
|
||||
// Created by Norbert Schmidt on 14-03-12.
|
||||
// Copyright (c) 2012 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface catalogus : NSObject {
|
||||
NSString *objectID;
|
||||
NSString *objectName;
|
||||
NSString *objectType;
|
||||
NSString *objectRA;
|
||||
NSString *objectDec;
|
||||
NSString *objectMagnitude;
|
||||
NSString *objectSize;
|
||||
NSString *objectConstellation;
|
||||
NSString *objectNotes;
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic, copy)NSString *objectID, *objectName, *objectType, *objectRA, *objectDec, *objectMagnitude, *objectSize, *objectConstellation, *objectNotes ;
|
||||
|
||||
+ (id)objectWithID:(NSString *)objectID
|
||||
objectName:(NSString *)objectName
|
||||
objectType:(NSString *)objectType
|
||||
objectRA:(NSString *)objectRA
|
||||
objectDec:(NSString *)objectDec
|
||||
objectMagnitude:(NSString *)objectMagnitude
|
||||
objectSize:(NSString *)objectSize
|
||||
objectConstellation:(NSString *)objectConstellation
|
||||
objectNotes:(NSString *)objectNotes;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
41
Classes/catalogus.m
Normal file
41
Classes/catalogus.m
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// ngcic.m
|
||||
// test
|
||||
//
|
||||
// Created by Norbert Schmidt on 14-03-12.
|
||||
// Copyright (c) 2012 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
|
||||
|
||||
#import "catalogus.h"
|
||||
|
||||
@implementation catalogus
|
||||
|
||||
@synthesize objectID,objectName, objectType,objectRA, objectDec, objectMagnitude, objectSize, objectConstellation, objectNotes;
|
||||
|
||||
+ (id) objectWithID:(NSString *)objectID objectName:(NSString *)objectName objectType:(NSString *)objectType objectRA:(NSString *)objectRA objectDec:(NSString *)objectDec objectMagnitude:(NSString *)objectMagnitude objectSize:(NSString *)objectSize objectConstellation:(NSString *)objectConstellation objectNotes:(NSString *)objectNotes{
|
||||
|
||||
catalogus *newObject = [[self alloc] init] ;
|
||||
newObject.objectID = objectID;
|
||||
newObject.objectName = objectName;
|
||||
newObject.objectType = objectType;
|
||||
newObject.objectRA = objectRA;
|
||||
newObject.objectDec = objectDec;
|
||||
newObject.objectMagnitude = objectMagnitude;
|
||||
newObject.objectSize = objectSize;
|
||||
newObject.objectConstellation = objectConstellation;
|
||||
newObject.objectNotes = objectNotes;
|
||||
|
||||
|
||||
return newObject;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
BIN
Classes/catalogus.sqlite
Normal file
BIN
Classes/catalogus.sqlite
Normal file
Binary file not shown.
33
Classes/coordinatetranslator.h
Executable file
33
Classes/coordinatetranslator.h
Executable file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// coordinatetranslator.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 25-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
|
||||
@interface coordinatetranslator : NSObject {
|
||||
|
||||
|
||||
|
||||
// NSdate *datum;
|
||||
double Long;
|
||||
double Lat;
|
||||
double Alti;
|
||||
double ALT ;
|
||||
double AZ ;
|
||||
double RA ;
|
||||
double DEC ;
|
||||
char ObjName ;
|
||||
char ObjRef ;
|
||||
char ObjAltName ;
|
||||
char ObjType ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
15
Classes/coordinatetranslator.m
Executable file
15
Classes/coordinatetranslator.m
Executable file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// coordinatetranslator.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 25-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "coordinatetranslator.h"
|
||||
|
||||
|
||||
@implementation coordinatetranslator
|
||||
|
||||
@end
|
||||
|
||||
39
Classes/customViewController.h
Normal file
39
Classes/customViewController.h
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// customViewController.h
|
||||
// iPushTo
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-03-12.
|
||||
// Copyright (c) 2012 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "GradientButton.h"
|
||||
@interface customViewController : UIViewController {
|
||||
|
||||
IBOutlet UIButton *hideKeyboardButton;
|
||||
IBOutlet GradientButton *submitButton;
|
||||
IBOutlet UITextField *txtRAuur;
|
||||
IBOutlet UITextField *txtRAminuut;
|
||||
IBOutlet UISegmentedControl *segPlusmin;
|
||||
IBOutlet UITextField *txtDECuur;
|
||||
IBOutlet UITextField *txtDECminuut;
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic,retain) IBOutlet UIButton *hideKeyboardButton;
|
||||
@property (nonatomic,retain) IBOutlet GradientButton *submitButton;
|
||||
@property (nonatomic,retain) IBOutlet UITextField *txtRAuur;
|
||||
@property (nonatomic,retain) IBOutlet UITextField *txtRAminuut;
|
||||
@property (nonatomic,retain) IBOutlet UISegmentedControl *segPlusmin;
|
||||
@property (nonatomic,retain) IBOutlet UITextField *txtDECuur;
|
||||
@property (nonatomic,retain) IBOutlet UITextField *txtDECminuut;
|
||||
|
||||
|
||||
|
||||
- (IBAction)hidekeyboard:(id)sender;
|
||||
-(IBAction)submitclick;
|
||||
-(BOOL) textfieldcheck;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
154
Classes/customViewController.m
Normal file
154
Classes/customViewController.m
Normal file
@@ -0,0 +1,154 @@
|
||||
//
|
||||
// customViewController.m
|
||||
// iPushTo
|
||||
//
|
||||
// Created by Norbert Schmidt on 02-03-12.
|
||||
// Copyright (c) 2012 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "customViewController.h"
|
||||
#import "MySingleton.h"
|
||||
@implementation customViewController
|
||||
|
||||
@synthesize hideKeyboardButton;
|
||||
@synthesize submitButton;
|
||||
@synthesize txtRAuur;
|
||||
@synthesize txtRAminuut;
|
||||
@synthesize segPlusmin;
|
||||
@synthesize txtDECuur;
|
||||
@synthesize txtDECminuut;
|
||||
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning
|
||||
{
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc that aren't in use.
|
||||
}
|
||||
|
||||
#pragma mark - View lifecycle
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view from its nib.
|
||||
[submitButton useBlackStyle];
|
||||
}
|
||||
|
||||
- (void)viewDidUnload
|
||||
{
|
||||
[super viewDidUnload];
|
||||
// Release any retained subviews of the main view.
|
||||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)hidekeyboard:(id)sender {
|
||||
[[self txtRAuur] resignFirstResponder];
|
||||
[[self txtRAminuut] resignFirstResponder];
|
||||
[[self txtDECuur] resignFirstResponder];
|
||||
[[self txtDECminuut] resignFirstResponder];
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)submitclick {
|
||||
if( [self textfieldcheck]) {
|
||||
self.tabBarController.selectedIndex = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-(BOOL)textfieldcheck {
|
||||
NSArray *fieldArray;
|
||||
int i = 0;
|
||||
|
||||
// Load up our field array with the UITextField Values
|
||||
fieldArray = [NSArray arrayWithObjects:
|
||||
[NSString stringWithFormat:@"%@",txtDECuur.text],
|
||||
[NSString stringWithFormat:@"%@",txtDECminuut.text],
|
||||
[NSString stringWithFormat:@"%@",txtRAuur.text],
|
||||
[NSString stringWithFormat:@"%@",txtRAminuut.text],nil] ;
|
||||
|
||||
// loop through the array, alert if text field is empty, and break the the loop, other wise increment i
|
||||
for (NSString *fieldText in fieldArray){
|
||||
if([fieldText isEqualToString:@""]){
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"Please Fill in All Required Fields." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
|
||||
[alert show];
|
||||
break;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
// Test voor M13
|
||||
// RA = 16 h 41.7 min
|
||||
// DEC = 36 d 28 min
|
||||
|
||||
// rechteklimming=16.695;
|
||||
// declinatie=36.46;
|
||||
|
||||
|
||||
|
||||
// check that all the field were passed (i == array.count) if so execute
|
||||
if(i == [[NSNumber numberWithInt: fieldArray.count] intValue]){
|
||||
|
||||
double RAuur=[txtRAuur.text doubleValue];
|
||||
double RAminuut=[txtRAminuut.text doubleValue];
|
||||
double DECuur=[txtDECuur.text doubleValue];
|
||||
double DECminuut=[txtDECminuut.text doubleValue];
|
||||
|
||||
NSString *RAString = [NSString stringWithFormat:@"%@.%@",txtRAuur.text,txtRAminuut.text ];
|
||||
NSString *DECstring = [NSString stringWithFormat:@"%@.%@",txtDECuur.text,txtDECminuut.text ];
|
||||
|
||||
|
||||
|
||||
double rechteklimming = (RAuur ) + (RAminuut /60) ;
|
||||
double declinatie=DECuur + (DECminuut / 60) ;
|
||||
if (self.segPlusmin.selectedSegmentIndex==1){ declinatie=declinatie*-1;};
|
||||
|
||||
// NSLog(@"Rechteklimming %.2f Declinatie %.2f" , rechteklimming, declinatie);
|
||||
|
||||
[MySingleton sharedMySingleton].declinatie= declinatie;
|
||||
[MySingleton sharedMySingleton].rechteklimming=rechteklimming;
|
||||
[MySingleton sharedMySingleton].objectkeuze=[NSString stringWithFormat:@"RA:%@ DEC:%@", RAString, DECstring];
|
||||
return true;
|
||||
|
||||
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)infoButtonClick:(id)sender{
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"The Custom coordinates window"
|
||||
message:@"Enter the right ascention and declination coordinates in Hours and Minutes here. Use N (North) for positive declination and S(South) for negative declination. Hit submit when done. "
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles: nil];
|
||||
[alert show];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
// Return YES for supported orientations
|
||||
return (interfaceOrientation == UIInterfaceOrientationPortrait);
|
||||
}
|
||||
|
||||
@end
|
||||
708
Classes/customViewController.xib
Normal file
708
Classes/customViewController.xib
Normal file
@@ -0,0 +1,708 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1552</int>
|
||||
<string key="IBDocument.SystemVersion">12D78</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.37</string>
|
||||
<string key="IBDocument.HIToolboxVersion">626.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">2083</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUIImageView</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBUISegmentedControl</string>
|
||||
<string>IBUITextField</string>
|
||||
<string>IBUIView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="975951072">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="191373211">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="IBUIButton" id="630136799">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{10, 6}, {301, 420}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="787152276"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:225</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor" id="489754225">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor" id="559412261">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">2</int>
|
||||
<int key="size">2</int>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">18</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUILabel" id="787152276">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{83, 20}, {155, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="927417700"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:328</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Enter custom values</string>
|
||||
<object class="NSColor" key="IBUITextColor" id="764016454">
|
||||
<int key="NSColorSpace">2</int>
|
||||
<bytes key="NSRGB">MSAwIDAAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription" id="1015161439">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">17</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont" id="78354329">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUILabel" id="815900968">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 80}, {88, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="897811759"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:328</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Object RA: </string>
|
||||
<object class="NSColor" key="IBUITextColor" id="2211037">
|
||||
<int key="NSColorSpace">2</int>
|
||||
<bytes key="NSRGB">MSAwIDAAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<reference key="IBUIFontDescription" ref="1015161439"/>
|
||||
<reference key="IBUIFont" ref="78354329"/>
|
||||
</object>
|
||||
<object class="IBUILabel" id="686356697">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 119}, {91, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="895590121"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:328</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Object Dec:</string>
|
||||
<reference key="IBUITextColor" ref="2211037"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<reference key="IBUIFontDescription" ref="1015161439"/>
|
||||
<reference key="IBUIFont" ref="78354329"/>
|
||||
</object>
|
||||
<object class="IBUITextField" id="897811759">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{164, 75}, {54, 31}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="732900136"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:304</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC41MDg1OTc5OTU5IDAgMAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUIText"/>
|
||||
<int key="IBUIBorderStyle">3</int>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">2</int>
|
||||
<bytes key="NSRGB">MSAxIDEAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
|
||||
<float key="IBUIMinimumFontSize">17</float>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<int key="IBUIKeyboardType">4</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription" id="1057128536">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">14</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont" id="691325483">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">14</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUITextField" id="732900136">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{222, 76}, {57, 31}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="686356697"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:304</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor" id="105195883">
|
||||
<int key="NSColorSpace">2</int>
|
||||
<bytes key="NSRGB">MC41MDk4MDM5NTA4IDAgMAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUIText"/>
|
||||
<int key="IBUIBorderStyle">3</int>
|
||||
<reference key="IBUITextColor" ref="489754225"/>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
|
||||
<float key="IBUIMinimumFontSize">17</float>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<int key="IBUIKeyboardType">4</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<reference key="IBUIFontDescription" ref="1057128536"/>
|
||||
<reference key="IBUIFont" ref="691325483"/>
|
||||
</object>
|
||||
<object class="IBUITextField" id="932783951">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{222, 114}, {57, 31}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="132762223"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:304</string>
|
||||
<reference key="IBUIBackgroundColor" ref="105195883"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUIText"/>
|
||||
<int key="IBUIBorderStyle">3</int>
|
||||
<reference key="IBUITextColor" ref="489754225"/>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
|
||||
<float key="IBUIMinimumFontSize">17</float>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<int key="IBUIKeyboardType">4</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<reference key="IBUIFontDescription" ref="1057128536"/>
|
||||
<reference key="IBUIFont" ref="691325483"/>
|
||||
</object>
|
||||
<object class="IBUITextField" id="849341359">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{165, 114}, {54, 31}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="932783951"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:304</string>
|
||||
<reference key="IBUIBackgroundColor" ref="105195883"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUIText"/>
|
||||
<int key="IBUIBorderStyle">3</int>
|
||||
<reference key="IBUITextColor" ref="489754225"/>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
|
||||
<float key="IBUIMinimumFontSize">17</float>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<int key="IBUIKeyboardType">4</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<reference key="IBUIFontDescription" ref="1057128536"/>
|
||||
<reference key="IBUIFont" ref="691325483"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="132762223">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{119, 166}, {83, 37}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="364062428"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:225</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUINormalTitle">SUBMIT</string>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="489754225"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">2</int>
|
||||
<bytes key="NSRGB">MSAwIDAAA</bytes>
|
||||
</object>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="559412261"/>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription" id="748031706">
|
||||
<int key="type">2</int>
|
||||
<double key="pointSize">15</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont" id="92504075">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUILabel" id="504859936">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{170, 49}, {42, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="377577082"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:328</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">HH</string>
|
||||
<reference key="IBUITextColor" ref="764016454"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUITextAlignment">1</int>
|
||||
<reference key="IBUIFontDescription" ref="1015161439"/>
|
||||
<reference key="IBUIFont" ref="78354329"/>
|
||||
</object>
|
||||
<object class="IBUILabel" id="377577082">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{229, 49}, {42, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="815900968"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:328</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">MM</string>
|
||||
<reference key="IBUITextColor" ref="764016454"/>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUITextAlignment">1</int>
|
||||
<reference key="IBUIFontDescription" ref="1015161439"/>
|
||||
<reference key="IBUIFont" ref="78354329"/>
|
||||
</object>
|
||||
<object class="IBUISegmentedControl" id="895590121">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{114, 115}, {47, 30}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="849341359"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:273</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBSegmentControlStyle">2</int>
|
||||
<int key="IBNumberOfSegments">2</int>
|
||||
<int key="IBSelectedSegmentIndex">0</int>
|
||||
<array key="IBSegmentTitles">
|
||||
<string>N</string>
|
||||
<string>S</string>
|
||||
</array>
|
||||
<array class="NSMutableArray" key="IBSegmentWidths">
|
||||
<real value="0.0"/>
|
||||
<real value="0.0"/>
|
||||
</array>
|
||||
<array class="NSMutableArray" key="IBSegmentEnabledStates">
|
||||
<boolean value="YES"/>
|
||||
<boolean value="YES"/>
|
||||
</array>
|
||||
<array class="NSMutableArray" key="IBSegmentContentOffsets">
|
||||
<string>{0, 0}</string>
|
||||
<string>{0, 0}</string>
|
||||
</array>
|
||||
<array class="NSMutableArray" key="IBSegmentImages">
|
||||
<object class="NSNull" id="4"/>
|
||||
<reference ref="4"/>
|
||||
</array>
|
||||
<object class="NSColor" key="IBTintColor">
|
||||
<int key="NSColorSpace">2</int>
|
||||
<bytes key="NSRGB">MC41MDk4MDM5NTA4IDAgMAA</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="927417700">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{293, 21}, {18, 19}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<reference key="NSNextKeyView" ref="504859936"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:225</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<float key="IBUIAlpha">0.20000000298023224</float>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">3</int>
|
||||
<bool key="IBUIShowsTouchWhenHighlighted">YES</bool>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="489754225"/>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
|
||||
</object>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="559412261"/>
|
||||
<reference key="IBUIFontDescription" ref="748031706"/>
|
||||
<reference key="IBUIFont" ref="92504075"/>
|
||||
</object>
|
||||
<object class="IBUIImageView" id="364062428">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{15, 242}, {290, 184}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:567</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">2</int>
|
||||
<bytes key="NSRGB">MC41MDk4MDM5NTA4IDAgMAA</bytes>
|
||||
</object>
|
||||
<float key="IBUIAlpha">0.40000000596046448</float>
|
||||
<int key="IBUIContentMode">2</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSCustomResource" key="IBUIImage">
|
||||
<string key="NSClassName">NSImage</string>
|
||||
<string key="NSResourceName">mount.png</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUILabel" id="1043589340">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{81, 216}, {158, 21}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:328</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Mount your device like this:</string>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">2</int>
|
||||
<bytes key="NSRGB">MC41MDk4MDM5NTA4IDAgMAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">13</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">13</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{320, 431}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSNextKeyView" ref="630136799"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
|
||||
</object>
|
||||
<object class="IBUISimulatedTabBarMetrics" key="IBUISimulatedBottomBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="191373211"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">hideKeyboardButton</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="630136799"/>
|
||||
</object>
|
||||
<int key="connectionID">11</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">txtRAuur</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="897811759"/>
|
||||
</object>
|
||||
<int key="connectionID">17</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">txtRAminuut</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="732900136"/>
|
||||
</object>
|
||||
<int key="connectionID">18</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">txtDECuur</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="849341359"/>
|
||||
</object>
|
||||
<int key="connectionID">19</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">txtDECminuut</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="932783951"/>
|
||||
</object>
|
||||
<int key="connectionID">20</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">submitButton</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="132762223"/>
|
||||
</object>
|
||||
<int key="connectionID">22</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">segPlusmin</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="895590121"/>
|
||||
</object>
|
||||
<int key="connectionID">24</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">submitclick</string>
|
||||
<reference key="source" ref="132762223"/>
|
||||
<reference key="destination" ref="975951072"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">21</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">hidekeyboard:</string>
|
||||
<reference key="source" ref="630136799"/>
|
||||
<reference key="destination" ref="975951072"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">infoButtonClick:</string>
|
||||
<reference key="source" ref="927417700"/>
|
||||
<reference key="destination" ref="975951072"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">27</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">1</int>
|
||||
<reference key="object" ref="191373211"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="787152276"/>
|
||||
<reference ref="815900968"/>
|
||||
<reference ref="686356697"/>
|
||||
<reference ref="132762223"/>
|
||||
<reference ref="897811759"/>
|
||||
<reference ref="849341359"/>
|
||||
<reference ref="932783951"/>
|
||||
<reference ref="732900136"/>
|
||||
<reference ref="377577082"/>
|
||||
<reference ref="630136799"/>
|
||||
<reference ref="895590121"/>
|
||||
<reference ref="504859936"/>
|
||||
<reference ref="927417700"/>
|
||||
<reference ref="364062428"/>
|
||||
<reference ref="1043589340"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="975951072"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="787152276"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="815900968"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="686356697"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">7</int>
|
||||
<reference key="object" ref="897811759"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">8</int>
|
||||
<reference key="object" ref="849341359"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">9</int>
|
||||
<reference key="object" ref="132762223"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">10</int>
|
||||
<reference key="object" ref="630136799"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">13</int>
|
||||
<reference key="object" ref="732900136"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">14</int>
|
||||
<reference key="object" ref="932783951"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">15</int>
|
||||
<reference key="object" ref="504859936"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">16</int>
|
||||
<reference key="object" ref="377577082"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">23</int>
|
||||
<reference key="object" ref="895590121"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">26</int>
|
||||
<reference key="object" ref="927417700"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">28</int>
|
||||
<reference key="object" ref="364062428"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">29</int>
|
||||
<reference key="object" ref="1043589340"/>
|
||||
<reference key="parent" ref="191373211"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">customViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="10.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="14.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="15.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="16.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<integer value="1" key="23.IUISegmentedControlInspectorSelectedSegmentMetadataKey"/>
|
||||
<string key="26.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="28.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="29.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="9.CustomClassName">GradientButton</string>
|
||||
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">29</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<real value="1552" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
|
||||
<string key="NS.key.0">mount.png</string>
|
||||
<string key="NS.object.0">{500, 280}</string>
|
||||
</object>
|
||||
<string key="IBCocoaTouchPluginVersion">2083</string>
|
||||
</data>
|
||||
</archive>
|
||||
16
Classes/untitled.h
Executable file
16
Classes/untitled.h
Executable file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// untitled.h
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 10-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
@interface untitled : UIViewController {
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
65
Classes/untitled.m
Executable file
65
Classes/untitled.m
Executable file
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// untitled.m
|
||||
// IDSC
|
||||
//
|
||||
// Created by Norbert Schmidt on 10-01-11.
|
||||
// Copyright 2011 DDQ. All rights reserved.
|
||||
//
|
||||
|
||||
#import "untitled.h"
|
||||
|
||||
|
||||
@implementation untitled
|
||||
|
||||
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
|
||||
/*
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
||||
if (self) {
|
||||
// Custom initialization.
|
||||
}
|
||||
return self;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Implement loadView to create a view hierarchy programmatically, without using a nib.
|
||||
- (void)loadView {
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// Override to allow orientations other than the default portrait orientation.
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// Return YES for supported orientations.
|
||||
return (interfaceOrientation == UIInterfaceOrientationPortrait);
|
||||
}
|
||||
*/
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
// Releases the view if it doesn't have a superview.
|
||||
[super didReceiveMemoryWarning];
|
||||
|
||||
// Release any cached data, images, etc. that aren't in use.
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
[super viewDidUnload];
|
||||
// Release any retained subviews of the main view.
|
||||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user