Crash while selecting row in component 1 in uipickerview in iOS 6
I had an application which was working fine till iOS 5.1. But recently with iOS 6 it has started giving crash when I try to select a row in a component programmatically. Following is my code:
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 40, 320, 216)];
pickerView.delegate=self;
pickerView.dataSource=self;
pickerView.showsSelectionIndicator=YES;
[pickerView setTag:10];
//[pickerView selectRow:0 inComponent:0 animated:YES];
int index1 = [arrHours indexOfObject:[arrTitle objectAtIndex:0]];
int index2 = [arrMins indexOfObject:[arrTitle objectAtIndex:1]];
[actionSheet addSubview:pickerView];
[pickerView selectRow:index1 inComponent:0 animated:YES];
[pickerView selectRow:index2 inComponent:1 animated:YES];
[pickerView release];
It runs fine when I try to select row in component 0 but I get crash when I try to select row in component 1.
iphone uipickerview ios6
add a comment |
I had an application which was working fine till iOS 5.1. But recently with iOS 6 it has started giving crash when I try to select a row in a component programmatically. Following is my code:
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 40, 320, 216)];
pickerView.delegate=self;
pickerView.dataSource=self;
pickerView.showsSelectionIndicator=YES;
[pickerView setTag:10];
//[pickerView selectRow:0 inComponent:0 animated:YES];
int index1 = [arrHours indexOfObject:[arrTitle objectAtIndex:0]];
int index2 = [arrMins indexOfObject:[arrTitle objectAtIndex:1]];
[actionSheet addSubview:pickerView];
[pickerView selectRow:index1 inComponent:0 animated:YES];
[pickerView selectRow:index2 inComponent:1 animated:YES];
[pickerView release];
It runs fine when I try to select row in component 0 but I get crash when I try to select row in component 1.
iphone uipickerview ios6
try printing the array .check if the datasource array is null or not?
– AppleDelegate
Sep 28 '12 at 11:08
yes checking the data helped me. I have added my answer.
– pankaj
Oct 7 '12 at 15:57
add a comment |
I had an application which was working fine till iOS 5.1. But recently with iOS 6 it has started giving crash when I try to select a row in a component programmatically. Following is my code:
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 40, 320, 216)];
pickerView.delegate=self;
pickerView.dataSource=self;
pickerView.showsSelectionIndicator=YES;
[pickerView setTag:10];
//[pickerView selectRow:0 inComponent:0 animated:YES];
int index1 = [arrHours indexOfObject:[arrTitle objectAtIndex:0]];
int index2 = [arrMins indexOfObject:[arrTitle objectAtIndex:1]];
[actionSheet addSubview:pickerView];
[pickerView selectRow:index1 inComponent:0 animated:YES];
[pickerView selectRow:index2 inComponent:1 animated:YES];
[pickerView release];
It runs fine when I try to select row in component 0 but I get crash when I try to select row in component 1.
iphone uipickerview ios6
I had an application which was working fine till iOS 5.1. But recently with iOS 6 it has started giving crash when I try to select a row in a component programmatically. Following is my code:
UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 40, 320, 216)];
pickerView.delegate=self;
pickerView.dataSource=self;
pickerView.showsSelectionIndicator=YES;
[pickerView setTag:10];
//[pickerView selectRow:0 inComponent:0 animated:YES];
int index1 = [arrHours indexOfObject:[arrTitle objectAtIndex:0]];
int index2 = [arrMins indexOfObject:[arrTitle objectAtIndex:1]];
[actionSheet addSubview:pickerView];
[pickerView selectRow:index1 inComponent:0 animated:YES];
[pickerView selectRow:index2 inComponent:1 animated:YES];
[pickerView release];
It runs fine when I try to select row in component 0 but I get crash when I try to select row in component 1.
iphone uipickerview ios6
iphone uipickerview ios6
edited Jan 2 at 22:13


halfer
14.7k759116
14.7k759116
asked Sep 28 '12 at 10:57
pankajpankaj
2,761125396
2,761125396
try printing the array .check if the datasource array is null or not?
– AppleDelegate
Sep 28 '12 at 11:08
yes checking the data helped me. I have added my answer.
– pankaj
Oct 7 '12 at 15:57
add a comment |
try printing the array .check if the datasource array is null or not?
– AppleDelegate
Sep 28 '12 at 11:08
yes checking the data helped me. I have added my answer.
– pankaj
Oct 7 '12 at 15:57
try printing the array .check if the datasource array is null or not?
– AppleDelegate
Sep 28 '12 at 11:08
try printing the array .check if the datasource array is null or not?
– AppleDelegate
Sep 28 '12 at 11:08
yes checking the data helped me. I have added my answer.
– pankaj
Oct 7 '12 at 15:57
yes checking the data helped me. I have added my answer.
– pankaj
Oct 7 '12 at 15:57
add a comment |
1 Answer
1
active
oldest
votes
ok found the error on debugging. The problem was because of 00 in the data. Earlier framework was converting it to 0 by itself but in new sdk (ios6) it started producing error when I was considering 00 as 0.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f12638695%2fcrash-while-selecting-row-in-component-1-in-uipickerview-in-ios-6%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
ok found the error on debugging. The problem was because of 00 in the data. Earlier framework was converting it to 0 by itself but in new sdk (ios6) it started producing error when I was considering 00 as 0.
add a comment |
ok found the error on debugging. The problem was because of 00 in the data. Earlier framework was converting it to 0 by itself but in new sdk (ios6) it started producing error when I was considering 00 as 0.
add a comment |
ok found the error on debugging. The problem was because of 00 in the data. Earlier framework was converting it to 0 by itself but in new sdk (ios6) it started producing error when I was considering 00 as 0.
ok found the error on debugging. The problem was because of 00 in the data. Earlier framework was converting it to 0 by itself but in new sdk (ios6) it started producing error when I was considering 00 as 0.
answered Oct 7 '12 at 15:56
pankajpankaj
2,761125396
2,761125396
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f12638695%2fcrash-while-selecting-row-in-component-1-in-uipickerview-in-ios-6%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
try printing the array .check if the datasource array is null or not?
– AppleDelegate
Sep 28 '12 at 11:08
yes checking the data helped me. I have added my answer.
– pankaj
Oct 7 '12 at 15:57