Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed : Multiple SimplePickerInputTableViewCells with different Items List in TableView #16 #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions PickerCellDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
A2592179190AB42E008C675C /* UIColor+Custom.m in Sources */ = {isa = PBXBuildFile; fileRef = A2592178190AB42E008C675C /* UIColor+Custom.m */; };
E29FBE09146BAF830090B25A /* IntegerInputTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E29FBE08146BAF830090B25A /* IntegerInputTableViewCell.m */; };
E2CA1A62146B09E00070B8B9 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2CA1A61146B09E00070B8B9 /* UIKit.framework */; };
E2CA1A64146B09E00070B8B9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2CA1A63146B09E00070B8B9 /* Foundation.framework */; };
Expand All @@ -19,12 +20,13 @@
E2CA1A7B146B09E10070B8B9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E2CA1A7A146B09E10070B8B9 /* ViewController.m */; };
E2CA1A86146B0A550070B8B9 /* DateInputTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E2CA1A85146B0A550070B8B9 /* DateInputTableViewCell.m */; };
E2CA1A89146B0CC80070B8B9 /* StringInputTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E2CA1A88146B0CC80070B8B9 /* StringInputTableViewCell.m */; };
E2CA1A8C146B0DB00070B8B9 /* UIColor+Custom.m in Sources */ = {isa = PBXBuildFile; fileRef = E2CA1A8A146B0DB00070B8B9 /* UIColor+Custom.m */; };
E2CA1A97146C49870070B8B9 /* PickerInputTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E2CA1A96146C49870070B8B9 /* PickerInputTableViewCell.m */; };
E2CA1A9B146C4CD90070B8B9 /* SimplePickerInputTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E2CA1A9A146C4CD90070B8B9 /* SimplePickerInputTableViewCell.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
A2592177190AB42E008C675C /* UIColor+Custom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Custom.h"; sourceTree = "<group>"; };
A2592178190AB42E008C675C /* UIColor+Custom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Custom.m"; sourceTree = "<group>"; };
E29FBE07146BAF830090B25A /* IntegerInputTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntegerInputTableViewCell.h; sourceTree = "<group>"; };
E29FBE08146BAF830090B25A /* IntegerInputTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IntegerInputTableViewCell.m; sourceTree = "<group>"; };
E2CA1A5D146B09E00070B8B9 /* PickerCellDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PickerCellDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -45,8 +47,6 @@
E2CA1A85146B0A550070B8B9 /* DateInputTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DateInputTableViewCell.m; sourceTree = "<group>"; };
E2CA1A87146B0CC70070B8B9 /* StringInputTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringInputTableViewCell.h; sourceTree = "<group>"; };
E2CA1A88146B0CC80070B8B9 /* StringInputTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StringInputTableViewCell.m; sourceTree = "<group>"; };
E2CA1A8A146B0DB00070B8B9 /* UIColor+Custom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+Custom.m"; sourceTree = "<group>"; };
E2CA1A8B146B0DB00070B8B9 /* UIColor+Custom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Custom.h"; sourceTree = "<group>"; };
E2CA1A95146C49870070B8B9 /* PickerInputTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PickerInputTableViewCell.h; sourceTree = "<group>"; };
E2CA1A96146C49870070B8B9 /* PickerInputTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PickerInputTableViewCell.m; sourceTree = "<group>"; };
E2CA1A99146C4CD90070B8B9 /* SimplePickerInputTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimplePickerInputTableViewCell.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -125,8 +125,8 @@
E2CA1A6A146B09E10070B8B9 /* InfoPlist.strings */,
E2CA1A6D146B09E10070B8B9 /* main.m */,
E2CA1A6F146B09E10070B8B9 /* PickerCellDemo-Prefix.pch */,
E2CA1A8A146B0DB00070B8B9 /* UIColor+Custom.m */,
E2CA1A8B146B0DB00070B8B9 /* UIColor+Custom.h */,
A2592177190AB42E008C675C /* UIColor+Custom.h */,
A2592178190AB42E008C675C /* UIColor+Custom.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -199,7 +199,7 @@
E2CA1A7B146B09E10070B8B9 /* ViewController.m in Sources */,
E2CA1A86146B0A550070B8B9 /* DateInputTableViewCell.m in Sources */,
E2CA1A89146B0CC80070B8B9 /* StringInputTableViewCell.m in Sources */,
E2CA1A8C146B0DB00070B8B9 /* UIColor+Custom.m in Sources */,
A2592179190AB42E008C675C /* UIColor+Custom.m in Sources */,
E29FBE09146BAF830090B25A /* IntegerInputTableViewCell.m in Sources */,
E2CA1A97146C49870070B8B9 /* PickerInputTableViewCell.m in Sources */,
E2CA1A9B146C4CD90070B8B9 /* SimplePickerInputTableViewCell.m in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>738C18F0-CD0C-44B8-B996-51926293FC53</string>
<string>85809DE3-8E78-4A0B-B7A9-F899E47FCDBD</string>
<key>IDESourceControlProjectName</key>
<string>PickerCellDemo</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>BDD35BD1-32F9-441D-B104-6F8F7F5ED22C</key>
<string>https://github.com/wannabegeek/PickerTableViewCell.git</string>
<key>1B7AAA05-5FAE-4577-A0F4-7AFDB12EB344</key>
<string>https://github.com/aqibmumtaz/PickerTableViewCell.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>PickerCellDemo.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>BDD35BD1-32F9-441D-B104-6F8F7F5ED22C</key>
<key>1B7AAA05-5FAE-4577-A0F4-7AFDB12EB344</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/wannabegeek/PickerTableViewCell.git</string>
<string>https://github.com/aqibmumtaz/PickerTableViewCell.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>BDD35BD1-32F9-441D-B104-6F8F7F5ED22C</string>
<string>1B7AAA05-5FAE-4577-A0F4-7AFDB12EB344</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>BDD35BD1-32F9-441D-B104-6F8F7F5ED22C</string>
<string>1B7AAA05-5FAE-4577-A0F4-7AFDB12EB344</string>
<key>IDESourceControlWCCName</key>
<string>PickerTableViewCell</string>
</dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2CA1A5C146B09E00070B8B9"
BuildableName = "PickerCellDemo.app"
BlueprintName = "PickerCellDemo"
ReferencedContainer = "container:PickerCellDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2CA1A5C146B09E00070B8B9"
BuildableName = "PickerCellDemo.app"
BlueprintName = "PickerCellDemo"
ReferencedContainer = "container:PickerCellDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2CA1A5C146B09E00070B8B9"
BuildableName = "PickerCellDemo.app"
BlueprintName = "PickerCellDemo"
ReferencedContainer = "container:PickerCellDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E2CA1A5C146B09E00070B8B9"
BuildableName = "PickerCellDemo.app"
BlueprintName = "PickerCellDemo"
ReferencedContainer = "container:PickerCellDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>PickerCellDemo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>E2CA1A5C146B09E00070B8B9</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
3 changes: 3 additions & 0 deletions PickerCellDemo/SimplePickerInputTableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@

@interface SimplePickerInputTableViewCell : PickerInputTableViewCell <UIPickerViewDataSource, UIPickerViewDelegate> {
NSString *value;
NSArray *values;
}

@property (nonatomic, strong) NSString *value;
@property (weak) IBOutlet id <SimplePickerInputTableViewCellDelegate> delegate;

- (void)setup:(NSArray *)list selectedRow:(int)selectedRow;

@end
35 changes: 20 additions & 15 deletions PickerCellDemo/SimplePickerInputTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,36 @@ @implementation SimplePickerInputTableViewCell
@synthesize delegate;
@synthesize value;

__strong NSArray *values = nil;

+ (void)initialize {
- (void)initialize {
values = [NSArray arrayWithObjects:@"Value 1", @"Value 2", @"Value 3", @"Value 4", @"Value 5", nil];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
self.picker.delegate = self;
self.picker.dataSource = self;
}
return self;
[self initialize];
}
return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
// Initialization code
self = [super initWithCoder:aDecoder];
if (self) {
// Initialization code
self.picker.delegate = self;
self.picker.dataSource = self;
}
return self;
[self initialize];
}
return self;
}

- (void)setup:(NSArray *)list selectedRow:(int)selectedRow {
values = list;
[self.picker selectRow:selectedRow inComponent:0 animated:YES];
[self pickerView:self.picker didSelectRow:selectedRow inComponent:0];
}

- (void)setValue:(NSString *)v {
Expand Down
15 changes: 15 additions & 0 deletions PickerCellDemo/UIColor+Custom.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// UIColor+Custom.h
// ShootStudio
//
// Created by Tom Fewster on 30/09/2011.
// Copyright (c) 2011 Tom Fewster. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface UIColor (Custom)

+ (UIColor *)blueTextColor;

@end
17 changes: 17 additions & 0 deletions PickerCellDemo/UIColor+Custom.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// UIColor+Custom.h
// ShootStudio
//
// Created by Tom Fewster on 30/09/2011.
// Copyright (c) 2011 Tom Fewster. All rights reserved.
//

#import "UIColor+Custom.h"

@implementation UIColor (Custom)

+ (UIColor *)blueTextColor {
return [UIColor colorWithRed:0.243 green:0.306 blue:0.435 alpha:1.0];
}

@end
Loading