Permalink
Browse files

Initial checkin.

  • Loading branch information...
Scott Andrew
Scott Andrew committed Oct 8, 2009
0 parents commit 35406338968bd83d8cccb8eb8303236c0f679d62
Showing with 2,940 additions and 0 deletions.
  1. +9 −0 .gitignore
  2. +20 −0 License
  3. +33 −0 Source/NSString+NSArrayExtension.h
  4. +43 −0 Source/NSString+NSArrayExtension.m
  5. +68 −0 Source/NWPickerField.h
  6. +197 −0 Source/NWPickerField.m
  7. +46 −0 Source/NWPickerView.h
  8. +122 −0 Source/NWPickerView.m
  9. BIN Source/downArrow.png
  10. +34 −0 TestApplication/English.lproj/Cars.plist
  11. +753 −0 TestApplication/English.lproj/MainWindow.xib
  12. +56 −0 TestApplication/English.lproj/States.plist
  13. +22 −0 TestApplication/FormViewController.h
  14. +104 −0 TestApplication/FormViewController.m
  15. +30 −0 TestApplication/PickerTest-Info.plist
  16. +312 −0 TestApplication/PickerTest.xcodeproj/project.pbxproj
  17. +21 −0 TestApplication/PickerTestAppDelegate.h
  18. +44 −0 TestApplication/PickerTestAppDelegate.m
  19. +8 −0 TestApplication/PickerTest_Prefix.pch
  20. +18 −0 TestApplication/build/Debug-iphonesimulator/PickerTest.app.dSYM/Contents/Info.plist
  21. BIN TestApplication/build/Debug-iphonesimulator/PickerTest.app.dSYM/Contents/Resources/DWARF/PickerTest
  22. BIN TestApplication/build/Debug-iphonesimulator/PickerTest.app/English.lproj/Cars.plist
  23. BIN TestApplication/build/Debug-iphonesimulator/PickerTest.app/English.lproj/MainWindow.nib
  24. BIN TestApplication/build/Debug-iphonesimulator/PickerTest.app/English.lproj/States.plist
  25. BIN TestApplication/build/Debug-iphonesimulator/PickerTest.app/Info.plist
  26. BIN TestApplication/build/Debug-iphonesimulator/PickerTest.app/PickerTest
  27. BIN TestApplication/build/Debug-iphonesimulator/PickerTest.app/PickerTest-Info.plist
  28. +1 −0 TestApplication/build/Debug-iphonesimulator/PickerTest.app/PkgInfo
  29. BIN TestApplication/build/Debug-iphonesimulator/PickerTest.app/downArrow.png
  30. BIN .../PickerTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/FormViewController.o
  31. BIN ...Test.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/NSString+NSArrayExtension.o
  32. BIN ...build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/NWPickerField.o
  33. BIN .../build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/NWPickerView.o
  34. BIN ...uild/PickerTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/NWPickerView.o~$
  35. 0 ...uild/PickerTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/NWPickerView.o~>
  36. +6 −0 ...ckerTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/PickerTest.LinkFileList
  37. BIN ...ckerTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/PickerTestAppDelegate.o
  38. BIN ...erTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/PickerTestAppDelegate.o~$
  39. 0 ...erTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/PickerTestAppDelegate.o~>
  40. BIN ...lication/build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/Objects-normal/i386/main.o
  41. BIN .../build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/PickerTest-all-target-headers.hmap
  42. BIN ...ion/build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/PickerTest-generated-files.hmap
  43. BIN .../build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/PickerTest-own-target-headers.hmap
  44. BIN ...ion/build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/PickerTest-project-headers.hmap
  45. +22 −0 TestApplication/build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/PickerTest.dep
  46. BIN TestApplication/build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/PickerTest.hmap
  47. +22 −0 TestApplication/build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/PickerTest~.dep
  48. +617 −0 TestApplication/build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/build-state.dat
  49. +299 −0 TestApplication/build/PickerTest.build/Debug-iphonesimulator/PickerTest.build/build-state~.dat
  50. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/categories.pbxbtree
  51. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/cdecls.pbxbtree
  52. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/decls.pbxbtree
  53. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/files.pbxbtree
  54. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/imports.pbxbtree
  55. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/pbxindex.header
  56. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/protocols.pbxbtree
  57. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/refs.pbxbtree
  58. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/strings.pbxstrings/control
  59. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/strings.pbxstrings/strings
  60. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/subclasses.pbxbtree
  61. BIN TestApplication/build/PickerTest.build/PickerTest.pbxindex/symbols0.pbxsymbols
  62. +17 −0 TestApplication/main.m
  63. +16 −0 version.plist
@@ -0,0 +1,9 @@
+# git ignore fle
+# comments start with hash
+
+#ignore build directory
+/build
+
+#ignore pbxuser and perspectivev3
+*.pbxuser
+*.perspectivev3
20 License
@@ -0,0 +1,20 @@
+ This source code is provided under BSD license, the conditions of which are listed below.
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted
+ provided that the following conditions are met:
+
+ • Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+ • Redistributions in binary form must reproduce the above copyright notice, this list of conditions
+ and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ • Neither the name of Positive Spin Media nor the names of its contributors may be used to endorse or
+ promote products derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGE.
@@ -0,0 +1,33 @@
+//
+// String_NSArrayExtension.h
+// NWPickerField.h
+//
+// Created by Scott Andrew on 9/28/09.
+// Copyright 2009 New Wave Digital Media. All rights reserved.
+//
+// This source code is provided under BSD license, the conditions of which are listed below.
+//
+// Redistribution and use in source and binary forms, with or without modification, are permitted
+// provided that the following conditions are met:
+//
+// • Redistributions of source code must retain the above copyright notice, this list of
+// conditions and the following disclaimer.
+// • Redistributions in binary form must reproduce the above copyright notice, this list of conditions
+// and the following disclaimer in the documentation and/or other materials provided with the distribution.
+// • Neither the name of Positive Spin Media nor the names of its contributors may be used to endorse or
+// promote products derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+// DAMAGE.
+
+@interface NSString(NSArrayExtension)
+
++ (id)stringWithFormat:(NSString *)format array:(NSArray*) arguments;
+
+@end
@@ -0,0 +1,43 @@
+//
+// String_NSArrayExtension.m
+// NWFieldPicker
+//
+// Created by Scott Andrew on 9/28/09.
+// Copyright 2009 New Wave Digital Media. All rights reserved.
+//
+// This source code is provided under BSD license, the conditions of which are listed below.
+//
+// Redistribution and use in source and binary forms, with or without modification, are permitted
+// provided that the following conditions are met:
+//
+// • Redistributions of source code must retain the above copyright notice, this list of
+// conditions and the following disclaimer.
+// • Redistributions in binary form must reproduce the above copyright notice, this list of conditions
+// and the following disclaimer in the documentation and/or other materials provided with the distribution.
+// • Neither the name of Positive Spin Media nor the names of its contributors may be used to endorse or
+// promote products derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+// DAMAGE.
+//
+// This was a great find on stack overflow. Can't claim it as mine..
+#import "NSString+NSArrayExtension.h"
+
+@implementation NSString(NSArrayExtension)
+
++ (id)stringWithFormat:(NSString *)format array:(NSArray*) arguments;
+{
+ char *argList = (char *)malloc(sizeof(NSString *) * [arguments count]);
+ [arguments getObjects:(id *)argList];
+ NSString* result = [[NSString alloc] initWithFormat:format arguments:argList];
+ free(argList);
+ return [result autorelease];
+}
+
+@end
@@ -0,0 +1,68 @@
+//
+// CNPickerField.h
+// NWFieldPicker
+//
+// Created by Scott Andrew on 9/25/09.
+// Copyright 2009 New Wave Digital Media. All rights reserved.
+//
+// This source code is provided under BSD license, the conditions of which are listed below.
+//
+// Redistribution and use in source and binary forms, with or without modification, are permitted
+// provided that the following conditions are met:
+//
+// • Redistributions of source code must retain the above copyright notice, this list of
+// conditions and the following disclaimer.
+// • Redistributions in binary form must reproduce the above copyright notice, this list of conditions
+// and the following disclaimer in the documentation and/or other materials provided with the distribution.
+// • Neither the name of Positive Spin Media nor the names of its contributors may be used to endorse or
+// promote products derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+// DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+extern NSString* UIPickerViewBoundsUserInfoKey;
+
+extern NSString* UIPickerViewWillShownNotification;
+extern NSString* UIPickerViewDidShowNotification;
+extern NSString* UIPickerViewWillHideNotification;
+extern NSString* UIPickerViewDidHideNotification;
+
+@class NWPickerView;
+@protocol NWPickerFieldDelegate;
+
+
+@interface NWPickerField : UITextField<UIPickerViewDataSource,
+ UIPickerViewDelegate> {
+@private
+ NWPickerView* pickerView;
+ NSMutableArray* componentStrings;
+ NSString* formatString;
+ UIImageView* indicator;
+
+ id<NWPickerFieldDelegate> delegate;
+
+}
+
+@property(nonatomic,assign) IBOutlet id<NWPickerFieldDelegate> delegate;
+@property(nonatomic, copy) NSString* formatString;
+
+-(void) selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated;
+-(NSInteger) selectedRowInComponent:(NSInteger)component;
+
+
+@end
+
+@protocol NWPickerFieldDelegate
+@required
+-(NSInteger) numberOfComponentsInPickerField:(NWPickerField*)pickerField;
+-(NSInteger) pickerField:(NWPickerField*)pickerField numberOfRowsInComponent:(NSInteger)component;
+-(NSString*) pickerField:(NWPickerField *)pickerField titleForRow:(NSInteger)row forComponent:(NSInteger)component;
+@end
@@ -0,0 +1,197 @@
+//
+// NWPickerField.m
+// NWFieldPicker
+//
+// Created by Scott Andrew on 9/25/09.
+// Copyright 2009 NewWaveDigitalMedia. All rights reserved.
+//
+// This source code is provided under BSD license, the conditions of which are listed below.
+//
+// Redistribution and use in source and binary forms, with or without modification, are permitted
+// provided that the following conditions are met:
+//
+// • Redistributions of source code must retain the above copyright notice, this list of
+// conditions and the following disclaimer.
+// • Redistributions in binary form must reproduce the above copyright notice, this list of conditions
+// and the following disclaimer in the documentation and/or other materials provided with the distribution.
+// • Neither the name of Positive Spin Media nor the names of its contributors may be used to endorse or
+// promote products derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+// DAMAGE.
+
+#import "NWPickerField.h"
+#import "NSString+NSArrayExtension.h"
+#import "NWPickerView.h"
+
+
+NSString* UIPickerViewBoundsUserInfoKey = @"UIPickerViewBoundsUserInfoKey";
+NSString* UIPickerViewWillShownNotification = @"UIPickerViewWillShownNotification";
+NSString* UIPickerViewDidShowNotification = @"UIPickerViewDidShowNotification";
+NSString* UIPickerViewWillHideNotification = @"UIPickerViewWillHideNotification";
+NSString* UIPickerViewDidHideNotification = @"UIPickerViewDidHideNotification";
+
+
+
+@implementation NWPickerField
+
+@synthesize delegate;
+@synthesize formatString;
+
+- (BOOL)canBecomeFirstResponder {
+ return YES;
+
+}
+
+-(BOOL) becomeFirstResponder {
+ // we will toggle our view here. This allows us to react properly
+ // when in a table cell.
+ if (pickerView.hidden = YES)
+ [pickerView toggle];
+
+ return YES;
+}
+
+
+-(void) dealloc {
+ delegate = nil;
+
+ // clean up..
+ [pickerView release];
+ [componentStrings release];
+ [formatString release];
+ [indicator release];
+
+ [super dealloc];
+}
+
+-(void) didMoveToSuperview {
+ // lets create a hidden picker view.
+ pickerView = [[NWPickerView alloc] initWithFrame:CGRectZero];
+ pickerView.hidden = YES;
+ pickerView.dataSource = self;
+ pickerView.delegate = self;
+ pickerView.showsSelectionIndicator = YES;
+ pickerView.field = self;
+
+ // lets load our indecicator image and get its size.
+ CGRect bounds = self.bounds;
+ UIImage* image = [UIImage imageNamed:@"downArrow.png"];
+ CGSize imageSize = image.size;
+
+ // create our indicator imageview and add it as a subview of our textview.
+ CGRect imageViewRect = CGRectMake((bounds.origin.x + bounds.size.width) - imageSize.width - 5, (bounds.size.height/2) - (imageSize.height/2), imageSize.width, imageSize.height);
+ indicator = [[UIImageView alloc] initWithFrame:imageViewRect];
+ [self addSubview:indicator];
+ indicator.image = image;
+ indicator.hidden = YES;
+
+ // set our default format string.
+ self.formatString = @"%@";
+}
+
+-(void) didMoveToWindow {
+ UIWindow* appWindow = [self window];
+
+ // the app window can be null when being popped off
+ // the controller stack.
+ if (appWindow != nil) {
+ CGRect windowBounds = [appWindow bounds];
+
+ // caluclate our hidden rect.
+ CGRect pickerHiddenFrame = windowBounds;
+ pickerHiddenFrame.origin.y = pickerHiddenFrame.size.height+216;
+ pickerHiddenFrame.size.height = 216;
+
+ // calucate our visible rect
+ CGRect pickerVisibleFrame = windowBounds;
+ pickerVisibleFrame.origin.y = windowBounds.size.height - 216;
+ pickerVisibleFrame.size.height = 216;
+
+ // tell the picker view the frames.
+ pickerView.hiddenFrame = pickerHiddenFrame;
+ pickerView.visibleFrame = pickerVisibleFrame;
+
+ // set the initial frame so its hidden.
+ pickerView.frame = pickerHiddenFrame;
+
+ // add the picker view to our window so its top most like a keyboard.
+ [appWindow addSubview:pickerView];
+
+ int component = 0;
+
+ // select the first items in each component by default.
+ for (component = 0; component < [pickerView numberOfComponents]; component++)
+ [self selectRow:0 inComponent:component animated:NO];
+ }
+}
+
+
+-(void) pickerViewHidden:(BOOL)wasHidden {
+ // hide our show our indicator when notified by the picker.
+ indicator.hidden = wasHidden;
+}
+
+
+#pragma mark -
+#pragma mark UIPickerView wrappers
+#pragma mark -
+
+-(void) selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL)animated {
+
+ // when selection is given then make sure we update our edit control and the picker.
+ [pickerView selectRow:row inComponent:component animated:animated];
+ [self pickerView:pickerView didSelectRow:row inComponent:component];
+}
+
+-(NSInteger) selectedRowInComponent:(NSInteger)component {
+ return [pickerView selectedRowInComponent:component];
+}
+
+#pragma mark -
+#pragma mark UIPickerViewDataSource handlers
+#pragma mark -
+
+// returns the number of 'columns' to display.
+-(NSInteger) numberOfComponentsInPickerView:(UIPickerView *)thePickerView {
+ // we always have 1..
+ NSInteger count = [delegate numberOfComponentsInPickerField:self];
+ NSInteger item = 0;
+
+ // if we have component strings release them.
+ if (componentStrings != nil)
+ [componentStrings release];
+
+ componentStrings = [[NSMutableArray alloc] init];
+
+ // put a blank place holder in here for nothing.
+ for (item = 0; item < count; item++) {
+ [componentStrings addObject:@""];
+ }
+
+ return count;
+}
+
+-(NSInteger) pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
+ return [delegate pickerField:self numberOfRowsInComponent:component];
+}
+
+-(NSString *) pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
+ return [delegate pickerField:self titleForRow:row forComponent:component];
+}
+
+
+- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
+ NSString* string = [delegate pickerField:self titleForRow:row forComponent:component];
+ [componentStrings replaceObjectAtIndex:component withObject:string];
+
+ // format our text representing the change in the selection.
+ self.text = [NSString stringWithFormat:formatString array:componentStrings];
+}
+@end
Oops, something went wrong.

0 comments on commit 3540633

Please sign in to comment.