Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8182137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:45:25+00:00 2026-06-07T00:45:25+00:00

In the tableView:cellForRowAtIndexPath: implementation of my UITableViewController subclass I’m using this code snippet: AlarmPicker

  • 0

In the tableView:cellForRowAtIndexPath: implementation of my UITableViewController subclass I’m using this code snippet:

AlarmPicker *alarmPicker = [[AlarmPicker alloc] init];
alarmPicker.scrollViewDelegate = alarmPicker;
[cell.contentView addSubview:alarmPicker.view];

AlarmPicker implements various UIScrollViewDelegate methods.

In AlarmPicker.h I’m declaring scrollViewDelegate as follows:

@property (assign) id<UIScrollViewDelegate> scrollViewDelegate;

This is then being used in the implementation part of AlarmPicker:

UIScrollView *returnScrollView = [[UIScrollView alloc] init];
...
returnScrollView.delegate = self.scrollViewDelegate;

Unfortunately scrollViewDelegate is always null in this AlarmPicker instance so the implemented delegate methods don’t get called at all.

A workaround would be to put the UIScrollViewDelegate method implementations into the class which does the alloc and init:

...
alarmPicker.scrollViewDelegate = self;
...

But that would be a very bad solution.

What do I have to do in order to tell the AlarmPicker instance that it should use itself as its delegate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:45:29+00:00Added an answer on June 7, 2026 at 12:45 am

    Is there some reason that you can’t just write returnScrollView.delegate = self in your AlarmPicker class?

    I don’t see any reason why your scrollViewDelegate member would be nil here, unless the line returnScrollView.delegate = self.scrollViewDelegate; is happening in your init method, in which case you could move it to a later method or pass the required delegate in your AlarmPicker’s init method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running the following code in tableView:cellForRowAtIndexPath: File *file = [[File alloc] init];
This - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if (cell.accessoryType
this code works fine until I start scrolling: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
The debugger threw me this error UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:
In one part of my code, i call UITableViewCell *cell = (UITableViewCell *)[self.tableView cellForRowAtIndexPath:indexPath];
UITableViewCell *cell = [tableViewController.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]]; [cell setFrame:CGRectMake(cell.frame.origin.x, cell.frame.origin.y - 34, cell.frame.size.width, cell.frame.size.height)];
I was calling UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; from -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath in
i have this that works: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath Item *objItem =
So, I am posting my code below. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath //
I am using below code in implementation file. The issue is when I click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.