Этот код дает тот же результат
foreach( $file as $line )
{
echo $line; //display "www.google.be"
echo $string; //also display "www.google.be"
//but when I then if the line contain the string, the function doesn't find
it!!!
$pos = stripos($line,$hostname);
var_dump($pos); // FALSE for all the test
}
Я сделал это в другом коде, и у меня никогда не было этой проблемы.
Нет. Но вы можете легко добавить представление изображения как вспомогательное представление к ячейке таблицы для того же эффекта.
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"foo.png"]];
cell.accessoryView = imageView;
[imageView release];
Это решение для добавления разных изображений в каждую ячейку....Just a Try
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
if(indexPath.row == 0) {
cell.image = [UIImage imageNamed:@"image.png"];
}
else if (indexPath.row == 1) {
cell.image = [UIImage imageNamed:@"image1.png"];
}